/* ============================================================
   NEXT EDGE — Landing Page
   Design system: deep royal blue (#0034B5) engineering identity
   Bilingual AR (RTL) / EN (LTR) via logical properties
   ============================================================ */

:root {
  /* Brand palette (derived from logo #0034B5) */
  --brand:      #0034B5;
  --brand-600:  #1E4FD8;
  --brand-400:  #3B6FF5;
  --brand-tint: #EAF0FF;

  /* Ink / neutrals (cool-toned, not warm) */
  --ink:    #0A1A3D;
  --ink-900:#06122B;
  --paper:  #FFFFFF;
  --mist:   #F3F6FC;
  --line:   #E3E9F6;
  --muted:  #57678C;

  /* Type */
  --sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  /* Layout */
  --maxw: 1180px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -22px rgba(10, 26, 61, .28);
  --shadow-soft: 0 8px 26px -14px rgba(10, 26, 61, .22);
  --ease: cubic-bezier(.16, .84, .44, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px;
  background: var(--brand); color: #fff; padding: 10px 18px;
  border-radius: 8px; z-index: 200; transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 3px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 16px;
  padding: 14px 28px; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s;
  white-space: nowrap;
}
.btn-sm { padding: 10px 20px; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 26px -12px rgba(0,52,181,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(0,52,181,.8); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-tint); }
.btn-white { background: #fff; color: var(--brand); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0,0,0,.4); }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-white:hover { border-color: #fff; background: rgba(255,255,255,.1); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-soft); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 74px; }
.brand-logo { height: 40px; width: auto; }
.nav { display: flex; gap: 30px; margin-inline: auto; }
.nav a {
  font-weight: 500; font-size: 15.5px; color: var(--ink); position: relative; padding: 6px 0;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0; height: 2px; width: 0;
  background: var(--brand); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--brand); }
.nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  font-family: var(--mono); font-weight: 600; font-size: 13px; letter-spacing: .5px;
  background: var(--mist); border: 1px solid var(--line); color: var(--ink);
  width: 46px; height: 40px; border-radius: 10px; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.lang-toggle:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }

.menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-btn span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s, opacity .3s; }
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: clamp(56px, 9vw, 110px) 0 clamp(60px, 8vw, 96px); overflow: hidden; }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(-52deg, rgba(0,52,181,.05) 0 1px, transparent 1px 22px);
  -webkit-mask-image: radial-gradient(120% 100% at 85% 0%, #000 0%, transparent 62%);
          mask-image: radial-gradient(120% 100% at 85% 0%, #000 0%, transparent 62%);
}
html[dir="ltr"] .hero-grid-bg {
  -webkit-mask-image: radial-gradient(120% 100% at 15% 0%, #000 0%, transparent 62%);
          mask-image: radial-gradient(120% 100% at 15% 0%, #000 0%, transparent 62%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 48px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1px;
  text-transform: uppercase; color: var(--brand);
  background: var(--brand-tint); padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero-title { font-size: clamp(2.1rem, 5vw, 3.55rem); line-height: 1.16; font-weight: 700; letter-spacing: -.5px; }
.ht-line { display: block; }
.ht-line.accent { color: var(--brand); }
.hero-sub { margin-top: 24px; font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--muted); max-width: 46ch; }
.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-tag {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13.5px; color: var(--ink); letter-spacing: .3px;
}
.hero-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 4px rgba(59,111,245,.18); animation: blink 2.4s var(--ease) infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:.35;} }

/* Hero visual: layered system stack */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 380px; }
.stack { width: min(100%, 440px); overflow: visible; }
.stack .layer {
  transform-origin: center; opacity: 0;
  animation: layerIn .8s var(--ease) forwards;
  animation-delay: calc(.25s + var(--i) * .18s);
}
.stack .layer:not(:first-child) { animation-name: layerFloat, layerIn; }
@keyframes layerIn {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stack .pulse-node { animation: nodePulse 2.6s var(--ease) infinite; transform-origin: 210px 92px; }
@keyframes nodePulse { 0%,100%{ transform: scale(1); opacity:1;} 50%{ transform: scale(1.5); opacity:.6;} }
.stack .pulse-line { stroke-dasharray: 60; stroke-dashoffset: 60; animation: dash 2.6s var(--ease) infinite; }
@keyframes dash { 0%{stroke-dashoffset:60;} 45%{stroke-dashoffset:0;} 100%{stroke-dashoffset:0; opacity:0;} }

.floating-chip {
  position: absolute; display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; box-shadow: var(--shadow-soft); opacity: 0;
  animation: chipIn .7s var(--ease) forwards;
}
.floating-chip .chip-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--brand-400); font-weight: 600; }
.floating-chip .chip-text { font-size: 14px; font-weight: 600; color: var(--ink); }
.chip-1 { inset-block-start: 8%; inset-inline-end: -4%; animation-delay: 1.1s; }
.chip-2 { inset-block-start: 44%; inset-inline-start: -8%; animation-delay: 1.35s; }
.chip-3 { inset-block-end: 6%; inset-inline-end: 4%; animation-delay: 1.6s; }
@keyframes chipIn { from{opacity:0; transform:translateY(14px);} to{opacity:1; transform:translateY(0);} }

/* ============================================================
   POSITIONING STRIP
   ============================================================ */
.strip { background: var(--ink-900); color: #fff; padding: 30px 0; }
.strip-quote {
  text-align: center; font-size: clamp(1.15rem, 2.6vw, 1.6rem); font-weight: 600; letter-spacing: -.3px;
}
.strip-quote .muted { color: var(--brand-400); }
.strip-quote span { display: inline; }

/* ============================================================
   SECTIONS (generic)
   ============================================================ */
.section { padding: clamp(64px, 9vw, 116px) 0; }
.section-head { max-width: 760px; margin-bottom: 52px; }
.section-label {
  font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1px;
  color: var(--brand); text-transform: uppercase; display: inline-block; margin-bottom: 16px;
}
.section-label.light { color: var(--brand-400); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-weight: 700; line-height: 1.25; letter-spacing: -.4px; }
.section-title.light { color: #fff; }
.section-intro { margin-top: 18px; font-size: 1.08rem; color: var(--muted); }
.section-intro.light { color: rgba(255,255,255,.75); }

/* ---------- ABOUT ---------- */
.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-lead p { color: var(--muted); margin-bottom: 18px; font-size: 1.06rem; }
.about-lead strong { color: var(--ink); font-weight: 600; }
.about-cards { display: grid; gap: 18px; }
.mini-card {
  background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.mini-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.mini-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 16px; }
.mini-icon svg { width: 22px; height: 22px; }
.mini-card h3 { font-size: 1.2rem; margin-bottom: 8px; font-weight: 700; }
.mini-card p { color: var(--muted); font-size: .98rem; }

/* ---------- PROCESS ---------- */
.process { background: var(--mist); }
.timeline { position: relative; display: grid; gap: 0; }
.tl-item {
  display: grid; grid-template-columns: 96px 1fr; gap: 28px; align-items: start;
  padding: 30px 0; border-top: 1px solid var(--line); position: relative;
}
.tl-item:first-child { border-top: none; }
.tl-num {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 600; color: var(--brand);
  line-height: 1; opacity: .9;
}
.tl-body h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; }
.tl-en { font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px; color: var(--brand-400); text-transform: uppercase; }
.tl-body p { color: var(--muted); margin-top: 12px; max-width: 68ch; font-size: 1.02rem; }
.process-note {
  margin-top: 38px; padding: 24px 28px; background: var(--brand); color: #fff;
  border-radius: var(--radius); font-size: 1.02rem; line-height: 1.8; box-shadow: var(--shadow);
}

/* ---------- SERVICES ---------- */
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  position: relative; overflow: hidden;
}
.service-card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; height: 3px; width: 0;
  background: var(--brand); transition: width .35s var(--ease);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.service-card:hover::before { width: 100%; }
.svc-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; transition: background .3s, color .3s; }
.service-card:hover .svc-icon { background: var(--brand); color: #fff; }
.svc-icon svg { width: 24px; height: 24px; }
.service-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.service-card p { color: var(--muted); font-size: .96rem; }
.service-cta-card { background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.service-cta-card::before { display: none; }
.service-cta-card h3 { color: #fff; }
.service-cta-card p { color: rgba(255,255,255,.72); margin-bottom: 14px; }
.svc-link { color: var(--brand-400); font-weight: 600; font-size: .98rem; }
.svc-link:hover { color: #fff; }

/* ---------- SECTORS ---------- */
.sectors { background: var(--ink-900); color: #fff; position: relative; overflow: hidden; }
.sectors::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(-52deg, rgba(255,255,255,.035) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.sectors .container { position: relative; z-index: 1; }
.sector-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sector-list li {
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 18px 22px;
  font-weight: 500; font-size: 1.02rem; display: flex; align-items: center; gap: 12px;
  transition: background .25s, border-color .25s, transform .25s;
}
.sector-list li::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--brand-400);
  transform: rotate(45deg); flex-shrink: 0;
}
.sector-list li:hover { background: rgba(59,111,245,.14); border-color: var(--brand-400); transform: translateX(-4px); }
html[dir="ltr"] .sector-list li:hover { transform: translateX(4px); }

/* ---------- WHY ---------- */
.why-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.why-text { margin-top: 20px; color: var(--muted); font-size: 1.1rem; max-width: 40ch; }
.why-steps { display: grid; gap: 12px; counter-reset: step; }
.why-steps li {
  counter-increment: step; display: flex; align-items: center; gap: 18px;
  background: var(--mist); border: 1px solid var(--line); border-radius: 12px; padding: 16px 22px;
  font-weight: 600; font-size: 1.08rem; transition: transform .25s, box-shadow .25s;
}
.why-steps li::before {
  content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 15px;
  color: var(--brand); font-weight: 600; width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand-tint); display: grid; place-items: center; flex-shrink: 0;
}
.why-steps li:hover { transform: translateX(-6px); box-shadow: var(--shadow-soft); }
html[dir="ltr"] .why-steps li:hover { transform: translateX(6px); }

/* ---------- CLOSER ---------- */
.closer { background: var(--brand); color: #fff; position: relative; overflow: hidden; text-align: center; }
.closer-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-52deg, rgba(255,255,255,.06) 0 1px, transparent 1px 24px);
  -webkit-mask-image: radial-gradient(120% 130% at 50% 0%, #000, transparent 70%);
          mask-image: radial-gradient(120% 130% at 50% 0%, #000, transparent 70%);
}
.closer-inner { position: relative; z-index: 1; max-width: 820px; margin-inline: auto; }
.closer-en { font-family: var(--mono); font-size: clamp(1.1rem, 2.6vw, 1.7rem); font-weight: 500; line-height: 1.5; letter-spacing: .5px; }
.closer-en span { color: rgba(255,255,255,.62); }
.closer-title { margin-top: 26px; font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.4; }
.closer-actions { margin-top: 38px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink-900); color: rgba(255,255,255,.72); padding: 66px 0 30px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-logo { height: 38px; width: auto; margin-bottom: 18px; }
.footer-brand p { max-width: 34ch; font-size: .98rem; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; font-weight: 600; }
.footer-col a, .footer-col span { display: block; margin-bottom: 12px; font-size: .96rem; transition: color .2s; }
.footer-col a:hover { color: var(--brand-400); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: .9rem;
}
.footer-badge { font-family: var(--mono); font-weight: 600; color: #fff; letter-spacing: .5px; }
.footer-badge sup { color: var(--brand-400); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .service-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .nav, .header-cta { display: none; }
  .menu-btn { display: flex; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; inset-inline: 0; top: 74px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: 8px 24px 20px; margin-inline: 0;
  }
  .nav.open a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav.open a::after { display: none; }

  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { min-height: 340px; order: 2; }
  .about-body { grid-template-columns: 1fr; gap: 36px; }
  .why-inner { grid-template-columns: 1fr; gap: 36px; }
  .sector-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .sector-list { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-num { font-size: 1.8rem; }
  .floating-chip { padding: 8px 12px; }
  .floating-chip .chip-text { font-size: 12.5px; }
  .strip-quote span { display: block; }
  .hero-actions .btn, .closer-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 400px) {
  .service-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .stack .layer, .floating-chip { opacity: 1; }
}
