/* ════════════════════════════════════════════════════════════════
   Ahmed Elshamy Portfolio — Main Stylesheet v2.0
   ════════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────────── */
:root {
  --red:       #B30000;
  --deep-red:  #7A0000;
  --glow:      #FF2A2A;
  --black:     #0B0B0B;
  --bg:        #0d0000;
  --glass:     rgba(255,255,255,0.06);
  --glass-2:   rgba(255,255,255,0.10);
  --border:    rgba(255,255,255,0.08);
  --text:      #EAEAEA;
  --muted:     #9A9A9A;
  --font-ar:   'Cairo', sans-serif;
  --font-en:   'Inter', sans-serif;
  --radius:    16px;
  --radius-lg: 24px;
}

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

html {
  font-size: 16px;
  /* Lenis handles scrolling — DO NOT set scroll-behavior:smooth here */
}

body {
  /* Continuous top-to-bottom gradient: deep dark red → pure black */
  background: linear-gradient(
    180deg,
    #3a0000 0%,
    #200000 8%,
    #130000 18%,
    #0f0000 30%,
    #0a0000 50%,
    #080000 70%,
    #060000 85%,
    #040000 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-en {
  font-family: var(--font-ar);   /* keep Cairo in English too for a consistent look */
  direction: ltr;
  text-align: left;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* ── Background canvas ───────────────────────────────────────────── */
#ae-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* All page sections sit above the canvas */
.ae-header,
.ae-hero,
.ae-section,
.ae-footer,
.ae-mobile-menu {
  position: relative;
  z-index: 1;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #040000; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

/* ── Section Base ──────────────────────────────────────────────────── */
.ae-section {
  padding: 120px 0;
  position: relative;
  background: transparent;
}

.ae-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section Title ─────────────────────────────────────────────────── */
.ae-section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 64px;
  text-align: center;
  position: relative;
}

.ae-section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--glow));
  margin: 16px auto 0;
  border-radius: 2px;
  box-shadow: 0 0 12px var(--glow);
}

/* ══════════════════════════════════════════════════════════════════
   HEADER / NAV
   ══════════════════════════════════════════════════════════════════ */
.ae-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1160px;
  z-index: 1000;
  background: rgba(6,0,0,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 60px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  will-change: top, opacity;
  transition: top 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.ae-header.hide {
  top: -100px;
  opacity: 0;
  pointer-events: none;
}

/* Header layout slots */
.ae-header__start {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
}

.ae-header__end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Center logo — absolutely centered so it never shifts the nav/lang slots */
.ae-header__center {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;   /* only the link itself is clickable */
}
.ae-header__logo {
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: auto;
  transition: transform 0.3s, filter 0.3s;
}
.ae-header__logo img {
  height: 38px; width: auto; max-width: 150px;
  object-fit: contain; display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.ae-header__logo:hover { transform: scale(1.06); }
@media (max-width: 768px) {
  .ae-header__logo img { height: 30px; max-width: 110px; }
}

/* Desktop: show nav inside __start, hide hamburger, hide the __start lang-btn */
.ae-header__start .ae-lang-btn { display: none; }   /* hidden on desktop */
.ae-hamburger { display: none; }                     /* hidden on desktop */

.ae-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.ae-nav a {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s;
  white-space: nowrap;
}

.ae-nav a:hover { color: var(--text); }

/* Blog nav link — subtle highlight (global, all pages) */
.ae-nav__blog { color: var(--glow); font-weight: 700; }

/* Lang button */
.ae-lang-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 40px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}

.ae-lang-btn:hover {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(179,0,0,0.4);
}

.ae-lang-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Hamburger ─────────────────────────────────────────────────────── */
.ae-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
  z-index: 1003;
}

.ae-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}

.ae-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ae-hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.ae-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Menu Overlay — slide-down ─────────────────────────────────────── */
.ae-mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* starts above viewport */
  transform: translateY(-100%);
  background: rgba(6,0,0,0.97);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  z-index: 1001;
  display: flex;          /* always in DOM — JS controls transform */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Height: enough to show all links comfortably */
  min-height: 420px;
  padding: 80px 32px 40px;
  transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
  /* Prevent interaction while hidden */
  pointer-events: none;
  visibility: hidden;
}

.ae-mobile-menu.is-open {
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.ae-mobile-menu__nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 380px;
  padding: 0 32px;
}

.ae-mobile-menu__nav a {
  display: block;
  width: 100%;
  padding: 18px 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.25s;
}

.ae-mobile-menu__nav a:hover,
.ae-mobile-menu__nav a:focus { color: var(--text); }

.ae-mobile-menu__close {
  position: absolute;
  top: 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.3s;
}

/* RTL: close button on right */
[dir="rtl"] .ae-mobile-menu__close { right: 24px; }
[dir="ltr"] .ae-mobile-menu__close { left: 24px; }

.ae-mobile-menu__close:hover { background: rgba(179,0,0,0.25); }

/* ══════════════════════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════════════════════ */
.ae-hero {
  position: relative;
  height: 100vh;
  min-height: 680px;
  /* Content sits lower — near chest of portrait */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.ae-hero__bg {
  position: absolute;
  inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.06) translateZ(0);
  will-change: transform;
}

.ae-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(30,0,0,0.30) 0%,
    rgba(8,0,0,0.20) 30%,
    rgba(6,0,0,0.60) 62%,
    rgba(4,0,0,0.88) 82%,
    #060000 95%,
    #040000 100%
  );
}

.ae-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px 88px;
  max-width: 800px;
  width: 100%;
}

/* ── Hero entrance animations ─────────────────────────────────────── */
.ae-hero__name,
.ae-hero__title,
.ae-hero__location,
.ae-hero__btns {
  opacity: 0;
  transform: translateY(30px);
}

.ae-hero.hero-animated .ae-hero__name {
  animation: hero-up 0.9s cubic-bezier(0.22,1,0.36,1) 0.25s forwards;
}
.ae-hero.hero-animated .ae-hero__title {
  animation: hero-up 0.9s cubic-bezier(0.22,1,0.36,1) 0.42s forwards;
}
.ae-hero.hero-animated .ae-hero__location {
  animation: hero-up 0.8s cubic-bezier(0.22,1,0.36,1) 0.58s forwards;
}
.ae-hero.hero-animated .ae-hero__btns {
  animation: hero-up 0.8s cubic-bezier(0.22,1,0.36,1) 0.72s forwards;
}

@keyframes hero-up {
  to { opacity: 1; transform: translateY(0); }
}

.ae-hero__name {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 700; /* Cairo Bold — not Black */
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 0%, #eaeaea 55%, var(--glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ae-hero__title {
  font-size: clamp(0.9rem, 2.2vw, 1.25rem);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

/* Location */
.ae-hero__location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  /* Green color for both icon and text */
  color: #22C55E;
  margin-bottom: 30px;
  letter-spacing: 0.06em;
}

.ae-hero__location svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  stroke: #22C55E;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* Soft glow pulse — gentle, not aggressive */
  animation: loc-glow 2.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes loc-glow {
  0%, 100% {
    filter: drop-shadow(0 0 0px rgba(34,197,94,0));
    opacity: 0.75;
  }
  45%, 55% {
    filter: drop-shadow(0 0 6px rgba(34,197,94,0.9)) drop-shadow(0 0 12px rgba(34,197,94,0.4));
    opacity: 1;
  }
}

.ae-hero__btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS  (shine sweep on all + no text-hiding bug)
   ══════════════════════════════════════════════════════════════════ */

/* Shared shine pseudo-element ─ on ::before so text (in span/plain)
   stays on top without needing extra z-index */
.ae-btn,
.ae-btn--cv,
.ae-btn--behance,
.ae-btn--wa {
  position: relative;
  overflow: hidden;
  isolation: isolate; /* creates stacking context so text stays above */
}

.ae-btn::before,
.ae-btn--cv::before,
.ae-btn--behance::before,
.ae-btn--wa::before {
  content: '';
  position: absolute;
  top: 0; left: -110%;
  width: 55%; height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.18) 50%,
    transparent 70%
  );
  transform: skewX(-15deg);
  animation: btn-shine 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes btn-shine {
  0%   { left: -110%; }
  28%  { left: 140%; }
  100% { left: 140%; }
}

/* Keep text and icons above shine */
.ae-btn > *,
.ae-btn--cv > *,
.ae-btn--behance > *,
.ae-btn--wa > * {
  position: relative;
  z-index: 1;
}

/* Inline text nodes inside buttons — wrap them to ensure z-index */
/* (already handled by isolation:isolate on the button itself) */

/* ── Primary (red) ─────────────────────────────────────────────────── */
.ae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  border: none;
  color: #fff;
  transition: box-shadow 0.35s, transform 0.35s, background 0.35s;
}

.ae-btn--primary {
  background: linear-gradient(135deg, var(--red) 0%, var(--deep-red) 100%);
  box-shadow: 0 4px 24px rgba(179,0,0,0.35);
}

.ae-btn--primary:hover {
  background: linear-gradient(135deg, var(--glow) 0%, var(--red) 100%);
  box-shadow: 0 8px 40px rgba(255,42,42,0.55);
  transform: translateY(-2px);
}

/* ── Ghost ──────────────────────────────────────────────────────────── */
.ae-btn--ghost {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
}

.ae-btn--ghost:hover {
  border-color: rgba(179,0,0,0.5);
  background: rgba(179,0,0,0.12);
  box-shadow: 0 0 24px rgba(179,0,0,0.2);
  transform: translateY(-2px);
}

/* ── CV large button ────────────────────────────────────────────────── */
.ae-btn--cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 48px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--red) 0%, var(--deep-red) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 0 40px rgba(179,0,0,0.35);
  animation: pulse-glow 2.8s ease-in-out infinite;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  border: none;
}

.ae-btn--cv:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 60px rgba(255,42,42,0.6);
  animation-play-state: paused;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(179,0,0,0.35); }
  50%       { box-shadow: 0 0 60px rgba(255,42,42,0.55), 0 0 80px rgba(179,0,0,0.2); }
}

/* ── Behance button ─────────────────────────────────────────────────── */
.ae-btn--behance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 34px;
  border-radius: 50px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(179,0,0,0.3);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.35s;
  margin-top: 18px;
}

.ae-btn--behance:hover {
  background: rgba(179,0,0,0.14);
  border-color: var(--red);
  box-shadow: 0 0 28px rgba(179,0,0,0.22);
  transform: translateY(-2px);
}

/* ── WhatsApp button ────────────────────────────────────────────────── */
.ae-btn--wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 17px 46px;
  border-radius: 50px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  box-shadow: 0 4px 28px rgba(37,211,102,0.28);
  transition: all 0.35s;
  margin-bottom: 56px;
  border: none;
}

.ae-btn--wa:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 50px rgba(37,211,102,0.48);
}

/* ══════════════════════════════════════════════════════════════════
   SERVICES SECTION
   ══════════════════════════════════════════════════════════════════ */
.ae-services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.ae-service-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}

.ae-service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(179,0,0,0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.ae-service-card:hover {
  border-color: rgba(179,0,0,0.42);
  box-shadow: 0 0 36px rgba(179,0,0,0.11), 0 20px 56px rgba(0,0,0,0.3);
  transform: translateY(-6px) !important; /* override reveal state */
}

.ae-service-card:hover::after { opacity: 1; }

.ae-service-card__icon {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, rgba(179,0,0,0.14), rgba(122,0,0,0.10));
  border: 1px solid rgba(179,0,0,0.22);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  transition: background 0.3s, box-shadow 0.3s;
}

.ae-service-card__icon svg {
  width: 26px; height: 26px;
  stroke: rgba(179,0,0,0.9);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.ae-service-card:hover .ae-service-card__icon {
  background: linear-gradient(135deg, rgba(179,0,0,0.24), rgba(122,0,0,0.16));
  box-shadow: 0 0 18px rgba(179,0,0,0.18);
}

.ae-service-card:hover .ae-service-card__icon svg { stroke: var(--glow); }

.ae-service-card__title {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 11px;
  color: var(--text);
}

.ae-service-card__desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.85;
}

/* ══════════════════════════════════════════════════════════════════
   CV SECTION
   ══════════════════════════════════════════════════════════════════ */
.ae-cv {
  text-align: center;
  padding: 100px 0;
}

.ae-cv__inner {
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(179,0,0,0.16);
  border-radius: var(--radius-lg);
  padding: 80px 40px;
  max-width: 580px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.ae-cv__inner::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(179,0,0,0.10), transparent 70%);
  pointer-events: none;
}

.ae-cv__label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  line-height: 1.9;       /* room for Arabic marks */
  padding: 0.12em 0;
}
/* Arabic: drop letter-spacing + uppercase which break Arabic shaping/clipping */
body:not(.lang-en) .ae-cv__label,
body:not(.lang-en) .ae-section-title,
body:not(.lang-en) .ae-hero__eyebrow {
  letter-spacing: normal;
  text-transform: none;
}

.ae-cv__heading {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 36px;
  position: relative;
}

.ae-cv__btns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  position: relative;
}

/* Both buttons equal width */
.ae-cv__btns .ae-btn--cv,
.ae-cv__btns .ae-btn--behance {
  flex: 1;
  max-width: 280px;
  min-width: 220px;
  margin-top: 0;
  justify-content: center;
  white-space: nowrap;
}

/* Mobile: stack vertically */
@media (max-width: 600px) {
  .ae-cv__btns {
    flex-direction: column;
    align-items: center;
  }
  .ae-cv__btns .ae-btn--cv,
  .ae-cv__btns .ae-btn--behance {
    width: 100%;
    max-width: 320px;
    flex: none;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ACHIEVEMENTS SECTION
   ══════════════════════════════════════════════════════════════════ */
.ae-achievements { text-align: center; }

/* Default: 2-col. Three-card variant overrides to 3-col */
.ae-achievements__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 700px;
  margin: 0 auto;
}

/* 3-card horizontal row on desktop */
.ae-achievements__grid--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
}

.ae-achievement-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  padding: 48px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.4s, box-shadow 0.4s;
}

/* Subtle red glow corner */
.ae-achievement-card::before {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(179,0,0,0.18), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Top red accent line */
.ae-achievement-card::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), var(--glow), transparent);
  border-radius: 0 0 4px 4px;
  opacity: 0.7;
}

.ae-achievement-card:hover {
  border-color: rgba(179,0,0,0.35);
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 30px rgba(179,0,0,0.08);
}

.ae-achievement-card__number {
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--glow), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 14px;
}

.ae-achievement-card__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .ae-achievements__grid--three {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PARTNERS — AUTO-SCROLLING CAROUSEL
   ══════════════════════════════════════════════════════════════════ */
.ae-partners-carousel {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  overflow: hidden;
  padding: 14px 0;
  min-height: 158px;   /* safety: never collapse even if children mis-size */
}

/* Soft edge fades using pseudo-elements (no mask — always reliable) */
.ae-partners-carousel::before,
.ae-partners-carousel::after {
  content: '';
  position: absolute; top: 0; bottom: 0;
  width: 80px; z-index: 3; pointer-events: none;
}
.ae-partners-carousel::before { left: 0;  background: linear-gradient(90deg,  #0b0000, transparent); }
.ae-partners-carousel::after  { right: 0; background: linear-gradient(270deg, #0b0000, transparent); }

/* The moving track — PHP outputs block twice; translate -50% = seamless loop */
.ae-partners-carousel__track {
  display: flex;
  width: max-content;
  align-items: stretch;
  animation: ae-marquee 40s linear infinite;
  will-change: transform;
}

@keyframes ae-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Each logo card — fixed size, always visible (force-override any reveal opacity) */
.ae-partner-card {
  flex: 0 0 auto;
  width: 190px;
  height: 130px;
  margin: 0 10px;                   /* 20px total between cards; exact card_span=210 */
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 1 !important;            /* never hidden by reveal/cache */
  transform: none !important;       /* never offset by reveal */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color 0.35s, box-shadow 0.35s, background 0.35s;
}
.ae-partner-card:hover {
  border-color: rgba(179,0,0,0.45);
  box-shadow: 0 0 28px rgba(179,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
}
.ae-partner-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  opacity: 0.85;
  filter: brightness(0) invert(1);  /* logos are white-on-transparent → keep white */
  transition: opacity 0.3s;
}
.ae-partner-card:hover img { opacity: 1; }

/* Reduced-motion: stop marquee, wrap into a centered row */
@media (prefers-reduced-motion: reduce) {
  .ae-partners-carousel__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .ae-partner-card { width: 150px; height: 108px; padding: 18px 18px; margin: 0 7px; }
  .ae-partners-carousel::before,
  .ae-partners-carousel::after { width: 40px; }
}

/* ══════════════════════════════════════════════════════════════════
   CONTACT SECTION
   ══════════════════════════════════════════════════════════════════ */
.ae-contact {
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Red radial glow (existing) */
.ae-contact::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(179,0,0,0.07), transparent 70%);
  pointer-events: none;
}

/* ── Map background ─────────────────────────────────────────────── */
.ae-contact__map {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

/* Saudi map image — blended into the background, edges dissolve */
.ae-contact__map-img {
  width: min(760px, 92%);
  height: auto;
  object-fit: contain;
  opacity: 0.07;                 /* very subtle, part of the background */
  filter: brightness(0) invert(1);
  user-select: none;
  /* Fade all edges so the silhouette melts into the page background */
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 35%, transparent 78%);
  mix-blend-mode: screen;        /* blends with the dark gradient instead of sitting on top */
}

/* ── WhatsApp button — desktop above title, mobile below location ── */

/* Desktop: show top WA, hide bottom WA */
.ae-contact__wa-top    { display: inline-flex; margin-bottom: 28px; }
.ae-contact__wa-bottom { display: none; }

/* Mobile: hide top WA, show bottom WA */
@media (max-width: 768px) {
  .ae-contact__wa-top    { display: none; }
  .ae-contact__wa-bottom { display: inline-flex; }
}

/* ── Location line ──────────────────────────────────────────────── */
.ae-contact__location {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(234,234,234,0.55);
  margin-bottom: 36px;
  letter-spacing: 0.04em;
}

/* Green pulsing dot */
.ae-location-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #22C55E;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  animation: loc-dot-pulse 2.5s ease-in-out infinite;
}

.ae-location-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid #22C55E;
  animation: loc-ring-expand 2.5s ease-in-out infinite;
}

@keyframes loc-dot-pulse {
  0%, 100% { box-shadow: 0 0 0   0   rgba(34,197,94,0); }
  50%       { box-shadow: 0 0 10px 3px rgba(34,197,94,0.55); }
}

@keyframes loc-ring-expand {
  0%   { transform: scale(1);   opacity: 0.8; }
  60%  { transform: scale(2.4); opacity: 0;   }
  100% { transform: scale(1);   opacity: 0;   }
}

.ae-contact__inner { position: relative; z-index: 1; }

.ae-contact__subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 16px;
  line-height: 2;            /* room for Arabic marks/descenders */
  padding: 0.15em 0;         /* prevent glyph clipping top/bottom */
}
/* Arabic: remove letter-spacing + uppercase (they break Arabic shaping) */
body:not(.lang-en) .ae-contact__subtitle {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.95rem;
}

.ae-contact__title {
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  font-weight: 900;
  margin-bottom: 16px;
}

.ae-contact__desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 32px;
}

/* Social Links — wraps to two rows for 6 icons */
.ae-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 380px;
  margin: 0 auto;
}

.ae-social__link {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  transition: all 0.35s;
  color: var(--muted);
  flex-shrink: 0;
}

.ae-social__link:hover {
  color: var(--text);
  border-color: rgba(179,0,0,0.5);
  box-shadow: 0 0 18px rgba(179,0,0,0.22);
  transform: scale(1.15);
}

.ae-social__link svg { width: 20px; height: 20px; }

/* ══════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════ */
.ae-footer {
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 64px 0 28px;
  font-size: 0.9rem;
  color: var(--muted);
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(122,0,0,0.06));
}
.ae-footer__glow {
  position: absolute; bottom: -120px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 300px;
  background: radial-gradient(circle, rgba(179,0,0,0.12), transparent 70%);
  pointer-events: none;
}

/* Grid layout: brand wide + 1 links column */
.ae-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  margin-bottom: 44px;
  position: relative; z-index: 1;
}

/* Brand */
.ae-footer__logo {
  display: inline-block;
  font-size: 1.6rem; font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--glow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.ae-footer__tagline {
  color: var(--muted); font-size: 0.95rem; line-height: 1.7;
  max-width: 340px; margin-bottom: 22px;
}
.ae-footer__social { display: flex; gap: 10px; }
.ae-footer__social a {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--muted);
  transition: all 0.28s;
}
.ae-footer__social a:hover {
  color: #fff; background: var(--red); border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(179,0,0,0.35);
}

/* Link columns */
.ae-footer__col-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin-bottom: 20px; position: relative; padding-bottom: 12px;
}
.ae-footer__col-title::after {
  content: ''; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 40px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--glow));
  box-shadow: 0 0 10px rgba(179,0,0,0.5);
}
.ae-footer__col ul { list-style: none; padding: 0; margin: 0; }
.ae-footer__col li { margin-bottom: 11px; }
.ae-footer__col a {
  color: var(--muted); font-size: 0.92rem; font-weight: 500;
  transition: color 0.25s, padding 0.25s; text-decoration: none;
  display: inline-block;
}
.ae-footer__col a:hover { color: var(--glow); padding-inline-start: 5px; }

/* Bottom bar */
.ae-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 24px; text-align: center;
  position: relative; z-index: 1;
}
.ae-footer__copy { margin: 0; font-size: 0.88rem; color: var(--muted); }
.ae-footer__copy a {
  color: var(--text); font-weight: 700; text-decoration: none;
  transition: color 0.25s;
}
.ae-footer__copy a:hover { color: var(--glow); }

@media (max-width: 820px) {
  .ae-footer { padding: 48px 0 24px; }
  .ae-footer__grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .ae-footer__brand { text-align: center; }
  .ae-footer__tagline { margin-inline: auto; }
  .ae-footer__social { justify-content: center; flex-wrap: wrap; }
  .ae-footer__col-title::after { inset-inline-start: 50%; transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════════════════ */
.ae-reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1);
}
.ae-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.ae-reveal--delay-1 { transition-delay: 0.12s; }
.ae-reveal--delay-2 { transition-delay: 0.24s; }
.ae-reveal--delay-3 { transition-delay: 0.36s; }
.ae-reveal--delay-4 { transition-delay: 0.48s; }

/* Service cards start hidden for scroll reveal */
.ae-service-card {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1),
              border-color 0.4s, box-shadow 0.4s;
}
.ae-service-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.ae-service-card.is-visible:hover { transform: translateY(-6px); }

/* ══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ae-header { top: 12px; padding: 11px 18px; width: calc(100% - 24px); }

  /* Desktop-only lang button hidden */
  .ae-lang-btn--desktop { display: none !important; }

  /* Hide desktop nav */
  .ae-nav { display: none !important; }

  /* Mobile layout:
     __start = LEFT  → shows only the lang-btn (nav is hidden)
     __end   = RIGHT → shows only the hamburger
  */
  .ae-header__start {
    flex: 0 0 auto;
    gap: 0;
  }
  .ae-header__start .ae-lang-btn {
    display: flex; /* visible on mobile in the left slot */
  }
  .ae-header__end {
    flex: 0 0 auto;
  }

  /* Hamburger visible on mobile */
  .ae-hamburger { display: flex; }

  .ae-hero { align-items: flex-end; }
  .ae-hero__content { padding: 0 20px 72px; }
  .ae-hero__name { font-size: 2.4rem; }

  .ae-services__grid { grid-template-columns: 1fr; }
  .ae-achievements__grid { grid-template-columns: 1fr; max-width: 360px; }
  .ae-achievements__grid--three { grid-template-columns: 1fr; max-width: 360px; }
  .ae-section { padding: 80px 0; }
  .ae-cv__inner { padding: 56px 24px; }
}

@media (max-width: 480px) {
  .ae-hero__btns { flex-direction: column; align-items: center; }
  .ae-btn--cv { padding: 15px 30px; font-size: 0.93rem; }
}

/* ── Reduce motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
