:root {
  --primary: #0f172a;
  /* Deep Navy / Charcoal */
  --secondary: #1e293b;
  --accent-blue: #2563eb;
  /* Strong Blue */
  --accent-red: #dc2626;
  /* Controlled Red for CTAs */
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-main: #334155;
  --text-light: #94a3b8;
  --text-inverse: #f8fafc;
  --border-color: #e2e8f0;

  --font-en: 'Inter', sans-serif;
  --font-ar: 'Tajawal', sans-serif;

  --transition: all 0.3s ease;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-en);
  color: var(--text-main);
  background: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

/* Language Toggle Logic */
html[lang="en"] .ar {
  display: none !important;
}

html[lang="ar"] .en {
  display: none !important;
}

/* Utilities */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section-padding {
  padding: 5rem 0;
}

.bg-light {
  background: var(--bg-light);
}

.bg-dark {
  background: var(--primary);
  color: var(--text-inverse);
}

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--accent-blue);
}

.mt-3 {
  margin-top: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mt-5 {
  margin-top: 3rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mb-5 {
  margin-bottom: 3rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4 {
  color: var(--text-inverse);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  gap: 2rem;
}

.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent-red);
  color: white;
}

.btn-primary:hover {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary);
}

.bg-light .btn-outline,
.certificates .btn-outline,
.lightbox .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}

.bg-light .btn-outline:hover,
.certificates .btn-outline:hover,
.lightbox .btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-block {
  width: 100%;
}

/* Float Actions */
.floating-actions {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html[lang="ar"] .floating-actions {
  right: auto;
  left: 20px;
}

.fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.fab:hover {
  transform: scale(1.1);
}

.fab.whatsapp {
  background: #25D366;
}

.fab.phone {
  background: var(--accent-blue);
}

.fab.email {
  background: var(--secondary);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.header-logo {
  height: auto;
  margin: 0;
  padding: 0;
  width: 150px;
  transition: var(--transition);
}

.header.scrolled .header-logo {
  width: 110px;
}

.footer-logo {
  max-width: 165px;
  padding: 0;
  margin: 0;
  height: auto;
  border-radius: 8px;
  background-color: white;
  /* to handle dark background if the logo has dark text */
  padding: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-blue);
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.lang-toggle:hover {
  background: var(--bg-light);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding-top: 80px;
  overflow: hidden;
}

.hero-video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ensure video is not cropped on mobile */
@media (max-width: 768px) {
  .hero-video {
    object-fit: contain;
  }

  .hero-video-wrapper {
    background-color: var(--primary);
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
}

.mute-toggle-btn {
  position: absolute;
  bottom: 30px;
  left: 30px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.mute-toggle-btn:hover {
  background: var(--accent-red);
  transform: scale(1.1);
}

html[lang="ar"] .mute-toggle-btn {
  left: auto;
  right: 30px;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 2rem;
  color: #e2e8f0;
  line-height: 1.8;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.trust-badges {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  backdrop-filter: blur(5px);
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge i {
  color: var(--accent-blue);
}

/* Stats & Map */
.stats {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 2.5rem 0;
  gap: 2rem;
  text-align: center;
}

.stat h2 {
  font-size: 2.5rem;
  color: var(--accent-blue);
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.stat p {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
}

.sectors .chip {
  display: inline-block;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.25rem;
  box-shadow: var(--shadow-sm);
}

/* About Section */
.about-flex {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.about-img img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  object-fit: cover;
}

.feature-list {
  margin: 2rem 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.feature-list i {
  color: var(--accent-blue);
  font-size: 1.5rem;
  margin-top: 0.2rem;
}

.mission-box {
  background: var(--bg-light);
  padding: 1.5rem;
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 8px 8px 0;
}

html[lang="ar"] .mission-box {
  border-left: none;
  border-right: 4px solid var(--accent-blue);
  border-radius: 8px 0 0 8px;
}

/* Capabilities */
.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  text-align: left;
  transition: var(--transition);
  border-top: 4px solid transparent;
}

.slider-track .card {
  width: 350px;
  flex-shrink: 0;
  white-space: normal;
}

html[lang="ar"] .card {
  text-align: right;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--accent-blue);
}

.card-icon {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.card ul {
  margin-top: 1rem;
}

.card ul li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

html[lang="ar"] .card ul li {
  padding-left: 0;
  padding-right: 1.5rem;
}

.card ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-size: 1.2rem;
  line-height: 1;
}

html[lang="ar"] .card ul li::before {
  left: auto;
  right: 0;
}

/* Products Gallery */
.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
  color: white;
  padding: 1.5rem 1rem 1rem;
  font-weight: 600;
  text-align: center;
}

/* Process */
.process .inputs-box {
  background: rgba(37, 99, 235, 0.1);
  padding: 1.5rem;
  border-radius: 8px;
}

.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding-top: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50px;
  right: 50px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.timeline-step {
  flex: 1;
  text-align: center;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

.step-num {
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin: -20px auto 1rem;
}

.timeline-step h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.timeline-step p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Animations for timeline */
.fade-up {
  opacity: 0;
  transform: translateY(0px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays manually if needed or via JS */
.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.3s;
}

.delay-3 {
  transition-delay: 0.5s;
}

.delay-4 {
  transition-delay: 0.7s;
}

.delay-5 {
  transition-delay: 0.9s;
}


/* Why Us */
.why-us {
  background: var(--primary);
  color: white;
  padding: 4rem 0;
}

.why-us h4 {
  color: white;
}

.why-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  text-align: center;
  gap: 2rem;
}

.why-item i {
  font-size: 2.5rem;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

/* Portfolio Slider */
.slider-wrapper {
  overflow: hidden;
  width: 100%;
  padding: 1rem 0;
  white-space: nowrap;
}

.slider-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: scroll-left 30s linear infinite;
  padding-bottom: 2rem;
  /* Give some breathing room for shadows */
}

.slider-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 0.75rem));
  }
}

html[lang="ar"] .slider-track {
  animation-name: scroll-right;
}

@keyframes scroll-right {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(50% + 0.75rem));
  }
}

.project-card {
  border-top: 4px solid var(--primary);
  padding: 1.5rem;
  text-align: left;
  width: 350px;
  flex-shrink: 0;
  white-space: normal;
}

@media (max-width: 768px) {
  .project-card {
    width: 280px;
  }
}

html[lang="ar"] .project-card {
  text-align: left;
  direction: ltr;
}

.project-card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.project-card .scope {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.project-card .detail {
  color: var(--text-light);
  line-height: 1.5;
}

/* Clients & Leadership */
.clients-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.client-badge {
  padding: 1rem 2rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-weight: 700;
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
  filter: grayscale(100%);
  transition: var(--transition);
  cursor: pointer;
}

.client-badge:hover {
  filter: grayscale(0);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--primary);
  border-color: var(--accent-blue);
}

.leader-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.leader-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--accent-blue);
  margin-bottom: 1.5rem;
  object-fit: cover;
}

/* Contact Form */
.contact-grid {
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.contact-list i {
  color: var(--accent-blue);
  font-size: 1.5rem;
  margin-top: 0.2rem;
}

form {
  background: white;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.form-row {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-light);
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 0;
}

.social-icons a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  margin: 0 0.5rem;
  font-size: 1.2rem;
}

.social-icons a:hover {
  background: var(--accent-blue);
  transform: translateY(-3px);
}

/* Responsive Options */
@media (max-width: 991px) {
  .about-flex {
    flex-direction: column;
    text-align: center;
  }

  .mission-box {
    border-radius: 8px;
    border: none;
    border-top: 4px solid var(--accent-blue);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .header-logo {
    width: 100px;
  }

  .header.scrolled .header-logo {
    width: 80px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .timeline {
    flex-direction: column;
    gap: 2rem;
    padding-top: 0;
  }

  .timeline::before {
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    height: 100%;
    right: auto;
  }

  html[lang="ar"] .timeline::before {
    right: 20px;
    left: auto;
  }

  .timeline-step {
    display: flex;
    align-items: flex-start;
    text-align: left;
    padding: 0;
    gap: 1rem;
  }

  html[lang="ar"] .timeline-step {
    text-align: right;
  }

  .step-num {
    margin: 0;
    min-width: 40px;
  }
}

/* Portfolio Filters */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: white;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

.lightbox-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  margin-top: 5%;
  text-align: center;
}

.lightbox-content img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.lightbox-info {
  color: white;
  padding: 20px;
}

.close-lightbox {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

html[lang="ar"] .close-lightbox {
  right: auto;
  left: 35px;
}

.close-lightbox:hover,
.close-lightbox:focus {
  color: var(--accent-red);
  text-decoration: none;
  cursor: pointer;
}