/* ============================================================
   مكتب منفّذون للمقاولات — Stylesheet
   Style: Exaggerated Minimalism · Light + Engineering Blue · RTL
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f6f8fb;
  --surface:   #ffffff;

  --navy:      #16385e;   /* primary */
  --navy-700:  #0f2942;
  --navy-900:  #0a1c2e;
  --blue:      #2563eb;   /* accent / CTA */
  --blue-600:  #1d4ed8;
  --blue-soft: #eaf1fe;

  --ink:       #0f172a;   /* text */
  --muted:     #64748b;
  --border:    #e2e8f0;

  --white:     #ffffff;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, .08), 0 4px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --container: 1200px;
  --ease:      cubic-bezier(.22, 1, .36, 1);     /* strong ease-out */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);

  --nav-h:     74px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
/* When Lenis JS smooth-scroll is active it manages scrolling itself */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Cairo", "Tajawal", sans-serif;
  line-height: 1.18;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -.01em;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}
.section { padding-block: clamp(44px, 6vw, 84px); }
.section--alt { background: var(--bg-alt); }

.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .14em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  padding-inline-start: 34px;
}
.eyebrow::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 50%;
  width: 26px; height: 2px;
  background: var(--blue);
  transform: translateY(-50%);
}

.section__head { max-width: 640px; margin-bottom: clamp(26px, 3.4vw, 42px); }
/* Static, polished title gradient — a fixed vertical metallic sweep (deep navy
   at the top → engineering blue → navy), no shimmer animation. */
.section__title {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  color: var(--navy); /* fallback if background-clip:text is unsupported */
  background: linear-gradient(180deg, #1b3e66 0%, #1d4ed8 58%, #14315a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section__sub { color: var(--muted); margin-top: 14px; font-size: 1.05rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed; top: -100px; inset-inline-start: 16px;
  background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: 8px; z-index: 1200; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; inset-inline-start: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--navy));
  z-index: 1100;
  transition: width .1s linear;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, .92);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--navy); color: #fff;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong { font-family: "Cairo", sans-serif; font-size: 1.18rem; color: var(--navy-900); font-weight: 800; }
.brand__text small { font-size: .76rem; color: var(--navy); font-weight: 600; }

.nav__links { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav__links a { font-weight: 500; color: var(--ink); position: relative; padding-block: 6px; transition: color .2s var(--ease); }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0;
  height: 2px; background: var(--blue); transform: scaleX(0);
  transform-origin: center; transition: transform .25s var(--ease);
}
.nav__links a:not(.nav__cta):hover { color: var(--navy); }
.nav__links a:not(.nav__cta):hover::after { transform: scaleX(1); }

.nav__cta {
  background: var(--navy); color: #fff !important;
  padding: 10px 22px; border-radius: 10px; font-weight: 700;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.nav__cta:hover { background: var(--blue); transform: translateY(-2px); }

.nav__toggle { display: none; width: 46px; height: 46px; flex-direction: column; justify-content: center; gap: 5px; padding: 0 11px; }
.nav__toggle span { display: block; height: 2.5px; background: var(--navy-900); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s var(--ease); }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1rem;
  padding: 14px 30px; border-radius: 12px;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  will-change: transform;
}
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .28); }
.btn--primary:hover { background: var(--blue-600); transform: translateY(-3px); box-shadow: 0 14px 28px rgba(37, 99, 235, .34); }
.btn--ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1.5px solid rgba(255, 255, 255, .5); backdrop-filter: blur(4px); }
.btn--ghost:hover { background: #fff; color: var(--navy-900); transform: translateY(-3px); border-color: #fff; }
.btn--whatsapp { background: #25d366; color: #fff; box-shadow: 0 8px 20px rgba(37, 211, 102, .28); margin-top: 26px; }
.btn--whatsapp:hover { background: #1ebe5a; transform: translateY(-3px); }
.btn--block { width: 100%; }

/* ============================================================
   SHINY 3D HOVER — interactive tilt + glossy highlight that
   follows the cursor. Applied via JS to buttons & cards.
   ============================================================ */
.fx-3d { position: relative; transform-style: preserve-3d; transition: transform .22s var(--ease), box-shadow .3s var(--ease); }
.fx-shine {
  position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; opacity: 0; z-index: 3;
  transition: opacity .35s var(--ease);
  background:
    radial-gradient(150px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 60%),
    linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .22) 48%, transparent 60%);
  mix-blend-mode: soft-light;
}
.fx-3d.is-tilting .fx-shine { opacity: 1; }
/* A crisp edge sheen to read as "glossy" on darker buttons */
.btn.fx-3d.is-tilting { box-shadow: 0 16px 34px rgba(15, 23, 42, .28), 0 0 0 1px rgba(255, 255, 255, .14) inset; }
/* Light / white buttons (ghost) need a tinted gloss — a white soft-light
   highlight is invisible on a white surface, so use an engineering-blue
   pool that follows the cursor with normal blending. */
.btn--ghost.fx-3d .fx-shine {
  mix-blend-mode: normal;
  background:
    radial-gradient(170px circle at var(--mx, 50%) var(--my, 50%), rgba(37, 99, 235, .26), rgba(37, 99, 235, 0) 62%),
    linear-gradient(105deg, transparent 34%, rgba(37, 99, 235, .16) 50%, transparent 62%);
}
.btn--ghost.fx-3d.is-tilting {
  box-shadow: 0 16px 34px rgba(37, 99, 235, .26), 0 0 0 1px rgba(37, 99, 235, .22) inset;
}
@media (prefers-reduced-motion: reduce) {
  .fx-3d { transform: none !important; }
  .fx-shine { display: none; }
}

/* ============================================================
   ENGINEERING 3D CARDS — a separate, blueprint-themed hover effect for
   cards (distinct from the glossy button effect): blueprint grid pooling
   under the cursor, survey corner marks, a scan sweep, and parallax depth.
   ============================================================ */
.eng-card {
  position: relative; transform-style: preserve-3d;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.eng-card.is-active {
  box-shadow: 0 26px 60px rgba(16, 56, 94, .24), 0 0 0 1px rgba(37, 99, 235, .30) inset;
  border-color: transparent; z-index: 2;
}
.eng-fx {
  position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  pointer-events: none; z-index: 2; opacity: 0; transition: opacity .4s var(--ease);
}
.eng-card.is-active .eng-fx { opacity: 1; }
/* blueprint grid, revealed in a soft pool that tracks the cursor */
.eng-fx__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .22) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(170px circle at var(--gx, 50%) var(--gy, 50%), #000 0%, rgba(0,0,0,.4) 46%, transparent 72%);
          mask-image: radial-gradient(170px circle at var(--gx, 50%) var(--gy, 50%), #000 0%, rgba(0,0,0,.4) 46%, transparent 72%);
}
/* survey / setting-out corner brackets that lock onto the card */
.eng-fx__corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--blue); }
.eng-fx__corner--tl { top: 9px; left: 9px; border-right: 0; border-bottom: 0; border-top-left-radius: 3px; }
.eng-fx__corner--tr { top: 9px; right: 9px; border-left: 0; border-bottom: 0; border-top-right-radius: 3px; }
.eng-fx__corner--bl { bottom: 9px; left: 9px; border-right: 0; border-top: 0; border-bottom-left-radius: 3px; }
.eng-fx__corner--br { bottom: 9px; right: 9px; border-left: 0; border-top: 0; border-bottom-right-radius: 3px; }
.eng-card.is-active .eng-fx__corner { animation: engCorner .5s var(--ease) both; }
@keyframes engCorner { from { opacity: 0; transform: scale(.4); } to { opacity: .9; transform: scale(1); } }
/* theodolite scan sweeping down the card (transform-only, compositor friendly) */
.eng-fx__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(127, 179, 255, .95), transparent);
  box-shadow: 0 0 14px 1px rgba(127, 179, 255, .65);
  animation: engScan 2.2s var(--ease) infinite;
}
@keyframes engScan {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(calc(var(--scanH, 240px) - 2px)); opacity: 0; }
}
/* parallax depth: inner layers lift toward the viewer while the card tilts */
.eng-card .service-card__icon,
.eng-card .why-card__icon,
.eng-card .project-card__media,
.eng-card h3 { transition: transform .35s var(--ease); }
.eng-card.is-active .service-card__icon,
.eng-card.is-active .why-card__icon { transform: translateZ(38px); }
.eng-card.is-active .project-card__media { transform: translateZ(26px); }
.eng-card.is-active h3 { transform: translateZ(20px); }
@media (prefers-reduced-motion: reduce) {
  .eng-card { transform: none !important; }
  .eng-fx { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h); overflow-x: clip;
  color: #fff;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(110% 90% at 78% 18%, #1c4f80 0%, #123a61 38%, #0c2540 68%, #0a1c2e 100%);
}
/* Animated ambient glow blobs (harmonized blue tones) */
.hero__bg::before, .hero__bg::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .55; pointer-events: none;
}
.hero__bg::before {
  width: 46vw; height: 46vw; inset-block-start: -10vw; inset-inline-start: -8vw;
  background: radial-gradient(circle, rgba(37, 99, 235, .55), transparent 70%);
  animation: heroBlobA 16s ease-in-out infinite alternate;
}
.hero__bg::after {
  width: 40vw; height: 40vw; inset-block-end: -14vw; inset-inline-end: -6vw;
  background: radial-gradient(circle, rgba(127, 179, 255, .4), transparent 70%);
  animation: heroBlobB 20s ease-in-out infinite alternate;
}
@keyframes heroBlobA { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 5vw) scale(1.15); } }
@keyframes heroBlobB { from { transform: translate(0, 0) scale(1); } to { transform: translate(-5vw, -4vw) scale(1.1); } }

/* --- Real-time CGI architectural scene (Three.js/WebGL) --- */
.hero__canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; display: block;
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft);
}
.hero__canvas.is-ready { opacity: 1; }

.hero__overlay {
  position: absolute; inset: 0; pointer-events: none;
  /* Cinematic grade over the 3D scene: a directional scrim that darkens the
     TEXT side (inline-start = right in RTL) for title legibility, plus a
     bottom vignette for depth. Tuned to never wash out the title. */
  background-image:
    linear-gradient(to left, rgba(8, 22, 38, .82) 0%, rgba(8, 22, 38, .5) 32%, rgba(8, 22, 38, .14) 62%, transparent 100%),
    linear-gradient(to top, rgba(8, 22, 38, .72) 0%, rgba(8, 22, 38, .1) 34%, transparent 58%);
}
.hero__content { position: relative; max-width: 760px; }
.hero__title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(6px, 0.14em, 14px);
  font-size: clamp(2.5rem, 7.5vw, 5.2rem);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.14;
  margin-bottom: 28px;
  padding-inline-start: 0.55em;
  border-inline-start: 4px solid #7fb3ff;
}
.hero__title-line {
  display: block;
  color: #fff;
  text-shadow: 0 2px 28px rgba(8, 22, 38, .45);
}
.hero__title-line--accent {
  color: #a8d4ff;
  text-shadow: 0 0 32px rgba(127, 179, 255, .35), 0 2px 20px rgba(8, 22, 38, .35);
}
.hero__lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: #e6eef8; max-width: 600px; margin-bottom: 38px; }
.hero__lead strong { color: #cfe7ff; font-weight: 700; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%);
  width: 26px; height: 44px; border: 2px solid rgba(255, 255, 255, .6); border-radius: 14px;
  display: grid; place-items: start center; padding-top: 7px;
}
.hero__scroll span { width: 5px; height: 10px; background: #fff; border-radius: 3px; box-shadow: 0 0 8px rgba(127, 179, 255, .7); animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(18px); } }

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.about__text p { color: var(--muted); margin-top: 18px; }
.about__text strong { color: var(--ink); }
.about__list { margin-top: 28px; display: grid; gap: 14px; }
.about__list li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--ink); }
.about__list svg { color: var(--blue); flex-shrink: 0; }

.about__media { position: relative; }
.about__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); aspect-ratio: 4/5; object-fit: cover; }
.about__media--offset {
  position: absolute; width: 52%; bottom: -28px; inset-inline-start: -28px;
  aspect-ratio: 1/1 !important; border: 6px solid #fff; box-shadow: var(--shadow-lg);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services { background: var(--bg-alt); }
.services__grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(3, 1fr);
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 30px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.service-card__icon {
  display: grid; place-items: center; width: 60px; height: 60px;
  border-radius: 16px; background: var(--blue-soft); color: var(--blue);
  margin-bottom: 22px; transition: background .3s var(--ease), color .3s var(--ease);
}
.service-card:hover .service-card__icon { background: var(--navy); color: #fff; }
.service-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: .98rem; }

/* ============================================================
   STATS
   ============================================================ */
.stats { background: var(--navy); color: #fff; padding-block: clamp(50px, 7vw, 86px); position: relative; overflow: hidden; }
.stats::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(127, 179, 255, .18), transparent 45%);
}
.stats__grid { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.stat__num { font-family: "Cairo", sans-serif; font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 900; color: #fff; display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { color: #b9cbe0; margin-top: 12px; font-size: 1rem; display: block; }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.project-card {
  background: var(--surface); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.project-card__media { aspect-ratio: 3/2; overflow: hidden; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project-card:hover .project-card__media img { transform: scale(1.07); }
.project-card__body { padding: 26px 26px 30px; }
.project-card__tag {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  color: var(--blue); background: var(--blue-soft); padding: 5px 14px; border-radius: 100px; margin-bottom: 14px;
}
.project-card h3 { font-size: 1.4rem; margin-bottom: 8px; }
.project-card p { color: var(--muted); font-size: .96rem; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery { background: var(--bg-alt); }
/* Two-row justified marquee: equal-height, varied-width images that
   auto-scroll in opposite directions. Each track is its 32 images plus an
   identical clone, so translateX(-50%) loops seamlessly. */
.gallery__marquee {
  --gh: 200px; --gap: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  perspective: 1600px;
  perspective-origin: 50% 50%;
}
/* Inner LTR keeps the marquee math predictable regardless of page RTL */
.gallery__stage { display: grid; gap: var(--gap); direction: ltr; transform-style: preserve-3d; will-change: transform; }
.gallery__row {
  overflow: hidden; min-width: 0; width: 100%;
  border-radius: var(--radius-sm);
  transform: translateZ(0);
  opacity: 1;
}
.gallery__track { display: flex; gap: var(--gap); width: max-content; will-change: transform; }
.gallery__row--right .gallery__track { animation: marqueeRight 60s linear infinite; }
.gallery__row--left .gallery__track { animation: marqueeLeft 70s linear infinite; }
.gallery__row:hover .gallery__track,
.gallery__row.is-paused .gallery__track { animation-play-state: paused; }
/* Freeze the strip entirely while the gallery is off screen */
.gallery__marquee.is-offscreen .gallery__track { animation-play-state: paused; }
@keyframes marqueeLeft { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@keyframes marqueeRight { from { transform: translate3d(-50%,0,0); } to { transform: translate3d(0,0,0); } }

.gallery__item {
  position: relative; flex: 0 0 auto; height: var(--gh);
  aspect-ratio: 4 / 3; /* overridden per-item inline with the real ratio */
  padding: 0; border: 0; background: #dde4ec;
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.gallery__item img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .55s var(--ease); }
.gallery__item:hover img { transform: scale(1.06); }
.gallery__item::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 28, 46, .42), transparent 55%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.gallery__item:hover::after { opacity: 1; }
.gallery__zoom {
  position: absolute; inset-block-end: 10px; inset-inline-end: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--navy);
  display: grid; place-items: center; opacity: 0; transform: scale(.7);
  transition: opacity .3s var(--ease), transform .3s var(--ease); pointer-events: none;
}
.gallery__item:hover .gallery__zoom { opacity: 1; transform: scale(1); }

/* ============================================================
   WHY US
   ============================================================ */
.why__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.why-card {
  padding: 32px 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.why-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.why-card__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--navy); color: #fff; margin-bottom: 20px; }
.why-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.why-card p { color: var(--muted); font-size: .96rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 70px); align-items: start; }
.contact__info > p { color: var(--muted); margin-top: 16px; }
.contact__list { margin-top: 32px; display: grid; gap: 20px; }
.contact__list li { display: flex; align-items: center; gap: 16px; }
.contact__ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); flex-shrink: 0; }
.contact__list small { display: block; color: var(--muted); font-size: .82rem; }
.contact__list a, .contact__list span span { font-weight: 700; color: var(--ink); }
.contact__list a:hover { color: var(--blue); }

.contact__form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-md); display: grid; gap: 18px;
}
.field { display: grid; gap: 8px; }
.field label { font-weight: 700; font-size: .92rem; color: var(--ink); }
.field input, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg-alt); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 16px; width: 100%;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  min-height: 48px; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: #9aa6b6; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #dc2626; background: #fef2f2; }
.field__error { color: #dc2626; font-size: .82rem; min-height: 1em; }
.form__note { text-align: center; font-weight: 600; min-height: 1.4em; }
.form__note.is-success { color: #15803d; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--navy-900); color: #cdd9e6; padding-top: clamp(48px, 6vw, 72px); }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; align-items: start; padding-bottom: 40px; }
.footer__brand .brand__text strong { color: #fff; font-size: 1.3rem; }
.footer__brand .brand__text small { color: #8aa0b8; margin-top: 6px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.footer__links a { color: #cdd9e6; font-weight: 500; transition: color .2s var(--ease); }
.footer__links a:hover { color: #fff; }
.footer__contact { display: grid; gap: 12px; }
.footer__contact-item {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(127, 179, 255, .14);
  color: #cdd9e6;
  transition: transform .35s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.footer__contact-item:hover {
  transform: translateY(-3px);
  background: rgba(127, 179, 255, .10);
  border-color: rgba(127, 179, 255, .42);
  color: #fff;
}
.footer__contact-icon {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(140deg, var(--blue), #1b4ea8);
  color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.footer__contact-item:hover .footer__contact-icon {
  transform: scale(1.06) rotate(-4deg);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .5);
}
.footer__contact-icon svg { width: 20px; height: 20px; }
.footer__contact-meta { display: grid; gap: 2px; line-height: 1.3; min-width: 0; }
.footer__contact-meta small { color: #8aa0b8; font-size: .72rem; letter-spacing: .04em; }
.footer__contact-meta bdi { font-weight: 600; font-size: 1rem; color: inherit; font-family: inherit; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: 22px; text-align: center; font-size: .88rem; color: #8aa0b8; }

/* ============================================================
   FLOATING WHATSAPP
   ============================================================ */
.fab-whatsapp {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px; z-index: 900;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .42);
  transition: transform .3s var(--ease);
}
.fab-whatsapp:hover { transform: scale(1.1) translateY(-2px); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(8, 18, 30, .92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__figure { max-width: min(92vw, 1100px); max-height: 86vh; text-align: center; }
.lightbox__figure img {
  max-width: 100%; max-height: 80vh; border-radius: 10px; object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  transform: scale(.94); transition: transform .35s var(--ease);
}
.lightbox.is-open .lightbox__figure img { transform: scale(1); }
.lightbox__caption { color: #cdd9e6; margin-top: 14px; font-size: .95rem; direction: ltr; unicode-bidi: isolate; }
.lightbox__close {
  position: absolute; top: 18px; inset-inline-end: 22px; z-index: 3;
  width: 50px; height: 50px; color: #fff; font-size: 2.4rem; line-height: 1;
  border-radius: 50%; background: rgba(12, 22, 36, .55);
  border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.lightbox__close:hover { background: rgba(255, 255, 255, .18); transform: scale(1.06); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 56px; height: 56px; color: #fff; font-size: 2.6rem; line-height: 1;
  background: rgba(12, 22, 36, .55); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(4px); border-radius: 50%;
  display: grid; place-items: center;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.lightbox__nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox__nav:active { transform: translateY(-50%) scale(.92); }
.lightbox__prev { inset-inline-end: 18px; }   /* RTL: "السابق" on the right */
.lightbox__next { inset-inline-start: 18px; }

/* ============================================================
   SCROLL REVEAL (base state — JS adds .is-visible)
   ============================================================ */
.js-reveal .reveal { opacity: 0; transform: translateY(26px); filter: blur(6px); will-change: transform, opacity; }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; filter: blur(0); transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .services__grid, .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .why__grid { grid-template-columns: repeat(2, 1fr); }
  .gallery__marquee { --gh: 170px; }
  .stats__grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset-block-start: var(--nav-h); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; padding: 18px clamp(18px, 4vw, 40px) 28px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    transform: translateY(-14px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .3s var(--ease), opacity .3s var(--ease), visibility .3s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  .nav__links a { padding: 14px 8px; border-radius: 8px; }
  .nav__links a:not(.nav__cta)::after { display: none; }
  .nav__links a:not(.nav__cta):active { background: var(--bg-alt); }
  .nav__cta { text-align: center; margin-top: 6px; }

  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 460px; margin-inline: auto; margin-top: 10px; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .services__grid, .projects__grid, .why__grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .service-card, .why-card { padding: 22px 16px; }
  .service-card__icon, .why-card__icon { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 14px; }
  .service-card h3, .why-card h3, .project-card h3 { font-size: 1.08rem; }
  .service-card p, .why-card p, .project-card p { font-size: .9rem; }
  .project-card__body { padding: 18px 16px 22px; }
  .project-card__tag { margin-bottom: 10px; }
  .gallery__marquee { --gh: 140px; --gap: 10px; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 30px 18px; }
  .footer__inner { grid-template-columns: 1fr; gap: 28px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .about__media--offset { width: 46%; inset-inline-start: -14px; bottom: -18px; }
  .lightbox__nav { width: 46px; height: 46px; font-size: 2rem; }
}

@media (max-width: 380px) {
  .gallery__marquee { --gh: 120px; }
}

/* ============================================================
   REDUCED MOTION — mandatory
   ============================================================ */
@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 !important; transform: none !important; filter: none !important; }
  .hero__bg::before, .hero__bg::after { animation: none !important; }
  .hero__scroll span { animation: none; }
  .gallery__track { animation: none !important; transform: none !important; }
  .gallery__row { overflow-x: auto; }
}
