/* ========================================
   CSS DESIGN SYSTEM - SOCIÉTÉ MAROC D'EAU
   ======================================== */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Water-themed Color Palette */
  --primary-blue: #00609c; /* Darker, more corporate blue */
  --primary-blue-dark: #004a7c;
  --primary-blue-light: #4fc3f7;
  --accent-cyan: #00bcd4;
  --text-dark: #2c3e50; /* Dark blue-gray instead of pure black */
  --text-light: #f8f9fa;

  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #0077be 0%, #00bcd4 100%);
  --gradient-hero: linear-gradient(
    135deg,
    rgba(0, 119, 190, 0.95) 0%,
    rgba(0, 188, 212, 0.85) 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );

  /* Neutral Colors */
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #e9ecef;
  --gray: #6c757d;
  --dark-gray: #343a40;
  --black: #1a1a1a;

  /* Spacing System */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 6rem;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Outfit', 'Inter', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;

  /* Layout */
  --max-width: 1280px;
  --header-height: 80px;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(180deg, #f4f7f6 0%, #e3eef5 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  /* Performance optimizations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== SERVICES SECTION ===== */
.services {
  background: transparent;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--black);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-5xl);
}
h2 {
  font-size: var(--font-size-4xl);
}
h3 {
  font-size: var(--font-size-3xl);
}
h4 {
  font-size: var(--font-size-2xl);
}
h5 {
  font-size: var(--font-size-xl);
}
h6 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--gray);
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--primary-blue-dark);
}

/* ===== UTILITIES ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-3xl) 0;
}

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--text-dark);
  position: relative;
  letter-spacing: -0.5px;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary-blue);
  margin: var(--spacing-md) auto 0;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 0.875rem;
  will-change: transform, box-shadow;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 96, 156, 0.2), 0 6px 14px rgba(0, 0, 0, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary-blue);
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  background: transparent;
  box-shadow: none;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.4s ease-in-out;
  height: var(--header-height);
  padding: 0 var(--spacing-md);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  height: 70px;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-md);
  position: relative;
}

.lang-icon {
  color: var(--primary-blue);
  opacity: 0.9;
  pointer-events: none;
  position: absolute;
  left: 10px;
  z-index: 1;
  transition: color var(--transition-base);
}

.header.scrolled .lang-icon {
  color: var(--primary-blue);
}

.lang-switcher select {
  padding: 10px 14px 10px 36px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.95);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.lang-switcher select:hover {
  background: var(--white);
  border-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lang-switcher select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 173, 239, 0.2);
}

.lang-switcher select option {
  background: var(--white);
  color: var(--text-dark);
  padding: 10px;
  font-weight: 600;
}

.header.scrolled .lang-switcher select {
  border-color: rgba(0, 96, 156, 0.2);
  background: var(--white);
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header.scrolled .lang-switcher select:hover {
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  transition: all var(--transition-base);
}

.logo-img {
  height: 40px;
  width: auto;
  transition: all var(--transition-base);
}

.logo-text {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  letter-spacing: -0.5px;
  transition: color var(--transition-base);
}

/* Mobile: Show "SME" instead of full name */
@media (max-width: 768px) {
  .logo-text {
    font-size: 0;
  }
  
  .logo-text::before {
    content: "SME";
    font-size: 1.25rem;
    font-weight: 700;
  }
}

.header.scrolled .logo-text {
  color: var(--primary-blue);
}

.header.scrolled .nav-link {
  color: var(--text-dark) !important; /* Force dark color when scrolled */
  opacity: 1;
}

.header.scrolled .nav-link::after {
  background-color: var(--primary-blue);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-xl); /* Increased gap for better spacing */
  align-items: center;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 28px;
  height: 2px;
  background: var(--white); /* White by default for video bg */
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
}

.header.scrolled .mobile-menu-toggle span {
  background: var(--text-dark); /* Dark when scrolled */
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  margin-top: 0;
}

.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 20, 40, 0.85) 0%,
    rgba(0, 60, 100, 0.8) 100%
  );
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease-out;
}

.hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.hero p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  line-height: 1.6;
  font-weight: var(--font-weight-normal);
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

@media (max-width: 768px) {
  .hero {
    min-height: 70vh;
  }

  .hero h1 {
    font-size: var(--font-size-3xl);
  }
  
  .hero p {
    font-size: var(--font-size-base);
  }

  .hero-buttons {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }

  /* Optimize video on mobile */
  .hero-video {
    object-fit: cover;
    object-position: center;
  }
}

/* ===== SERVICES SECTION ===== */
.services {
  background: var(--white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-blue);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: bottom;
}

.service-card:hover::before {
  transform: scaleY(1);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  border-color: transparent;
}

.service-card:hover {
  border-color: rgba(0, 96, 156, 0.2);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: rgba(0, 96, 156, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-md);
  color: var(--primary-blue);
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  background: var(--primary-blue);
  color: var(--white);
  box-shadow: 0 4px 10px rgba(0, 96, 156, 0.3);
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.5px;
}

.service-card p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
  flex-grow: 1;
}

/* Remove pseudo-link */
.service-card::after {
  display: none;
}

/* ===== ABOUT SECTION ===== */
.about {
  background: var(--white);
}

/* ===== ABOUT SECTION ===== */
.about {
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-3xl);
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

.about-text h3 {
  font-size: 1.75rem;
  color: var(--primary-blue);
  margin-bottom: var(--spacing-lg);
  font-weight: 600;
  line-height: 1.3;
}

.about-text p {
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
  color: var(--gray);
}

.about-text p strong {
  color: var(--text-dark);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-2xl);
  margin-top: var(--spacing-2xl);
  padding: var(--spacing-2xl) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  display: block;
  margin-bottom: var(--spacing-xs);
  font-family: var(--font-secondary);
}

.nav-link {
  text-decoration: none;
  color: var(--white) !important; /* Force white color at top */
  font-weight: 500;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  opacity: 0.9;
  position: relative;
  padding-bottom: 5px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--white);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
  line-height: 1.4;
}

.about-image {
  background-image: url('assets/images/about-bg-ai.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg);
  height: 600px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
}

.about-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 43, 73, 0.6));
}

/* ===== PROJECTS SECTION ===== */
.projects {
  background: var(--white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.project-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 96, 156, 0.08);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 96, 156, 0.15), 0 0 0 1px rgba(0, 96, 156, 0.08) inset;
}

.project-image {
  height: 250px;
  position: relative;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
  z-index: 1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover .project-image::before {
  opacity: 1;
}

.project-content {
  padding: var(--spacing-lg);
}

.project-content h3 {
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.2px;
}

.project-content p {
  color: var(--gray);
  margin-bottom: var(--spacing-md);
}

.project-meta {
  display: flex;
  gap: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--gray);
}

/* ===== CONTACT SECTION ===== */
.contact {
  background: #f8f9fa;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--spacing-3xl);
  margin-top: var(--spacing-2xl);
}

.contact-info h3 {
  font-size: 1.5rem;
  color: var(--primary-blue);
  margin-bottom: var(--spacing-xl);
  font-weight: 600;
}

.contact-item {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  align-items: flex-start;
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
}

.contact-item p {
  color: var(--gray);
  line-height: 1.6;
  margin: 0;
}

.contact-item a {
  color: var(--primary-blue);
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

.contact-form {
  background: var(--white);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: var(--spacing-xl);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e0e4e8;
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  color: var(--text-dark);
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: #c5d0dd;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(0, 96, 156, 0.08);
  background: #fafbfc;
}

.form-group input:focus:invalid,
.form-group textarea:focus:invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  background: #001a2d; /* Even darker navy for footer */
  color: var(--white);
  padding: var(--spacing-3xl) 0 var(--spacing-lg);
  font-size: 0.9rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: var(--spacing-xl);
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: var(--spacing-lg);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
}

.footer-section h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent-cyan);
}

.footer-section p {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--white);
  transform: translateX(5px);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ACCESSIBILITY ===== */
/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary-blue);
  color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: 10000;
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible styles */
*:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Honeypot field (hide from humans, visible to bots) */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ===== FORM STATUS MESSAGES ===== */
.form-status {
  display: none;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  font-weight: var(--font-weight-medium);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-status-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-status-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===== LOADING SPINNER ===== */
.btn-loader {
  display: inline-block;
  width: 20px;
  height: 20px;
}

.spinner {
  animation: rotate 1s linear infinite;
}

.spinner circle {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===== IMAGE OPTIMIZATION ===== */
img {
  max-width: 100%;
  height: auto;
  /* Performance: GPU acceleration for images */
  transform: translateZ(0);
  will-change: transform;
}

/* Hide lazy images only until they finish loading */
img[loading="lazy"]:not(.loaded) {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* If JS disabled, ensure images still visible */
noscript img[loading="lazy"] { opacity: 1; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 968px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
  }

  .about-content,
  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--white);
    flex-direction: column;
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    transition: left var(--transition-base);
  }

  .nav-menu.active {
    left: 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

/* Minimal RTL adjustments when Arabic is active */
[dir="rtl"] body {
  direction: rtl;
}

[dir="rtl"] .nav-menu {
  text-align: right;
}

[dir="rtl"] .section-title::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .about-text h3::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .contact-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .project-meta {
  justify-content: flex-end;
}

/* RTL spacing and icon alignment tweaks */
[dir="rtl"] .nav-menu .nav-link {
  padding-left: 0;
  padding-right: var(--spacing-md);
}

[dir="rtl"] .hero,
[dir="rtl"] .about-section,
[dir="rtl"] .services,
[dir="rtl"] .projects,
[dir="rtl"] .studies,
[dir="rtl"] .partners,
[dir="rtl"] .contact {
  text-align: right;
}

[dir="rtl"] .contact-item .icon,
[dir="rtl"] .service-card .icon,
[dir="rtl"] .project-card .icon,
[dir="rtl"] .btn .icon {
  margin-left: var(--spacing-sm);
  margin-right: 0;
}

[dir="rtl"] .contact-item,
[dir="rtl"] .service-card .header,
[dir="rtl"] .project-card .header {
  gap: var(--spacing-sm);
}

[dir="rtl"] ul,
[dir="rtl"] ol {
  padding-left: 0;
  padding-right: var(--spacing-lg);
}

[dir="rtl"] li::marker,
[dir="rtl"] .list li::before {
  margin-left: var(--spacing-sm);
  margin-right: 0;
}

[dir="rtl"] .breadcrumbs,
[dir="rtl"] .project-meta,
[dir="rtl"] .stats {
  flex-direction: row-reverse;
}

[dir="rtl"] .form-field label {
  text-align: right;
}

[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] textarea {
  text-align: right;
}

@media (max-width: 480px) {
  :root {
    --spacing-3xl: 3rem;
    --font-size-5xl: 2rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .about-stats {
    grid-template-columns: 1fr;
  }
}
