/* ============================================================
   AL-MANSOURA UNITED CONTRACTING - Custom Stylesheet
   A modern, comprehensive CSS for construction company website
   ============================================================ */

/* Hero initial state handled by GSAP in setupHeroAnimations() */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --primary: #1e2a5e;
  --primary-light: #2d3f7a;
  --primary-dark: #121b40;
  --accent-red: #c1272d;
  --accent-red-light: #e63946;
  --gold: #d4a843;

  /* Neutrals */
  --dark: #0a0f1e;
  --dark-surface: #111827;
  --light: #f5f5f7;
  --light-surface: #ffffff;
  --steel: #6b7280;
  --concrete: #9ca3af;

  /* Semantic */
  --bg: var(--light);
  --bg-surface: var(--light-surface);
  --bg-surface-alt: #eef0f4;
  --text: #1a1a2e;
  --text-secondary: var(--steel);
  --text-muted: var(--concrete);
  --border-color: rgba(0, 0, 0, 0.08);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.6);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-en: "Inter", system-ui, -apple-system, sans-serif;
  --font-ar: "Cairo", "Tajawal", sans-serif;
  --font-display: "Inter", var(--font-en);

  /* Spacing */
  --section-py: clamp(4rem, 8vw, 8rem);
  --container-px: clamp(1rem, 4vw, 2rem);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-cursor: 9998;
  --z-loader: 9999;
  --z-scroll-progress: 9997;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: var(--dark);
  --bg-surface: var(--dark-surface);
  --bg-surface-alt: #1a2234;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: rgba(255, 255, 255, 0.08);
  --card-bg: rgba(17, 24, 39, 0.8);
  --card-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Dark mode overrides for Tailwind utility classes */
[data-theme="dark"] body {
  background-color: #0a0f1e !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-gray-50 {
  background-color: #0a0f1e !important;
}
[data-theme="dark"] .bg-gray-100 {
  background-color: #111827 !important;
}
[data-theme="dark"] .text-gray-900 {
  color: #f3f4f6 !important;
}
[data-theme="dark"] .text-gray-800 {
  color: #e5e7eb !important;
}
[data-theme="dark"] .text-gray-700 {
  color: #d1d5db !important;
}
[data-theme="dark"] .text-gray-600 {
  color: #9ca3af !important;
}
[data-theme="dark"] .text-gray-500 {
  color: #9ca3af !important;
}
[data-theme="dark"] .text-gray-400 {
  color: #d1d5db !important;
}
[data-theme="dark"] .text-gray-300 {
  color: #e5e7eb !important;
}
[data-theme="dark"] .text-primary {
  color: #7b8cce !important;
}
[data-theme="dark"] .text-steel {
  color: #9ca3af !important;
}
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200 {
  border-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .glass {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}
[data-theme="dark"] section.bg-gray-50 .group:not(.project-card),
[data-theme="dark"] section.bg-white .group:not(.project-card) {
  background-color: #1a2332 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: #1a2332 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] label {
  color: #d1d5db !important;
}
[data-theme="dark"] .bg-primary-50,
[data-theme="dark"] .bg-green-50,
[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] .bg-amber-50 {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .text-accent-red {
  color: #f87171 !important;
}
[data-theme="dark"] .text-gold {
  color: #fbbf24 !important;
}

/* Dark mode: green text used on ISO badges and safety section */
[data-theme="dark"] .text-green-700 {
  color: #4ade80 !important;
}
[data-theme="dark"] .text-green-600 {
  color: #4ade80 !important;
}

/* Dark mode: red-50 background for ISO card */
[data-theme="dark"] .bg-red-50 {
  background-color: rgba(248, 113, 113, 0.08) !important;
}

/* Dark mode: primary/5 background for ISO card */
[data-theme="dark"] .bg-primary\/5 {
  background-color: rgba(123, 140, 206, 0.08) !important;
}

/* Dark mode: accent-red/10 background for service badge */
[data-theme="dark"] .bg-accent-red\/10 {
  background-color: rgba(248, 113, 113, 0.12) !important;
}

/* Dark mode: border colors */
[data-theme="dark"] .border-gray-300 {
  border-color: rgba(255, 255, 255, 0.12) !important;
}
[data-theme="dark"] .border-gray-200\/50 {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Dark mode: filter buttons */
[data-theme="dark"] .filter-btn {
  background-color: #1a2332 !important;
  color: #d1d5db !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .filter-btn.active {
  background-color: #1e2a5e !important;
  color: #ffffff !important;
  border-color: #1e2a5e !important;
}
[data-theme="dark"] .filter-btn:hover:not(.active) {
  background-color: #1f2937 !important;
}

/* Dark mode: contact info cards (bg-gray-50 inside contact section) */
[data-theme="dark"] #contact .bg-gray-50 {
  background-color: #1a2332 !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Core values cards: ensure text turns white on hover */
#about .bg-gray-50.hover-lift:hover h4,
#about .bg-gray-50.hover-lift:hover {
  color: #ffffff !important;
}

/* Dark mode: core values cards */
[data-theme="dark"] #about .bg-gray-50:not(section) {
  background-color: #1a2332 !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] #about .bg-gray-50.hover-lift:hover {
  background-color: #1e2a5e !important;
}
[data-theme="dark"] #about .bg-gray-50.hover-lift:hover h4 {
  color: #ffffff !important;
}

/* Dark mode: ISO cert card borders */
[data-theme="dark"] .border-primary\/20 {
  border-color: rgba(123, 140, 206, 0.25) !important;
}
[data-theme="dark"] .border-green-500\/20 {
  border-color: rgba(74, 222, 128, 0.25) !important;
}
[data-theme="dark"] .border-accent-red\/20 {
  border-color: rgba(248, 113, 113, 0.25) !important;
}

/* Dark mode: service card border color */
[data-theme="dark"] .service-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Dark mode: map iframe border */
[data-theme="dark"] .border-gray-200 {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Dark mode: hide white gradient overlay on services section */
[data-theme="dark"] #services > .from-white {
  display: none !important;
}

/* Dark mode: services section group hover text color fix */
[data-theme="dark"] .service-card .group-hover\:text-primary:hover,
[data-theme="dark"] .service-card h3 {
  color: #e5e7eb !important;
}

/* Dark mode: industry card icon background tweaks */
[data-theme="dark"] .bg-primary\/10 {
  background-color: rgba(123, 140, 206, 0.15) !important;
}
[data-theme="dark"] .bg-accent-red\/10 {
  background-color: rgba(248, 113, 113, 0.15) !important;
}
[data-theme="dark"] .bg-gold\/10 {
  background-color: rgba(212, 168, 67, 0.15) !important;
}

/* Dark mode: footer bottom bar border */
[data-theme="dark"] .border-gray-800 {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ===== LIGHT MODE FIXES ===== */
/* Client marquee: text-gray-300 is too light on gray-50 background */
#clients .text-gray-300 {
  color: #6b7280 !important;
}
#clients .text-gray-300:hover {
  color: #1e2a5e !important;
}

/* Dark mode: client marquee text should be lighter */
[data-theme="dark"] #clients .text-gray-300 {
  color: #9ca3af !important;
}
[data-theme="dark"] #clients .text-gray-300:hover {
  color: #7b8cce !important;
}

/* Dark mode: safety section text-gray-600 bullets */
[data-theme="dark"] #safety .text-gray-600 {
  color: #9ca3af !important;
}

/* Dark mode: ISO card heading colors */
[data-theme="dark"] #safety .text-primary {
  color: #7b8cce !important;
}
[data-theme="dark"] #safety .text-green-700 {
  color: #4ade80 !important;
}
[data-theme="dark"] #safety .text-accent-red {
  color: #f87171 !important;
}

/* Dark mode: contact form focus ring color visibility */
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  --tw-ring-color: rgba(123, 140, 206, 0.5) !important;
  box-shadow: 0 0 0 2px rgba(123, 140, 206, 0.5) !important;
  border-color: rgba(123, 140, 206, 0.5) !important;
}

/* Timeline section: glass cards need dark bg since section is bg-dark in both modes */
#timeline .glass {
  background: rgba(10, 15, 30, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#timeline h2 {
  color: #ffffff !important;
}

#timeline h3 {
  color: #ffffff !important;
}

#timeline .text-gray-400 {
  color: #9ca3af !important;
}

/* Careers section: ensure all text is readable on gradient background */
#careers h2 {
  color: #ffffff !important;
}

#careers p {
  color: rgba(255, 255, 255, 0.85) !important;
}

#careers .text-gray-300 {
  color: rgba(255, 255, 255, 0.8) !important;
}

#careers .glass {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#careers .glass p {
  color: #ffffff !important;
}

/* ============================================================
   2. BASE STYLES
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-surface);
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

html::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-full);
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* Global focus-visible style for keyboard accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

body {
  font-family: var(--font-en);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic font override */
[lang="ar"] body,
.font-ar {
  font-family: var(--font-ar);
  direction: rtl;
}

::selection {
  background-color: var(--accent-red);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--accent-red);
  color: #ffffff;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  color: var(--text-secondary);
  max-width: 70ch;
}

/* ============================================================
   3. PAGE LOADER
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo white background container */
.logo-bg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px 10px;
  flex-shrink: 0;
}

.logo-bg img {
  display: block;
  height: auto;
  width: auto;
}

/* Loader logo */
#page-loader .loader-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease-in-out infinite;
}

#page-loader .loader-logo .logo-bg {
  padding: 12px 18px;
  border-radius: 16px;
}

#page-loader .loader-logo .logo-bg img {
  height: 70px;
  width: auto;
}

/* Navbar logo bg */
.nav-logo-bg {
  padding: 4px 8px;
  border-radius: 10px;
}
.nav-logo-bg img {
  height: 36px;
  width: auto;
}

/* Footer logo bg */
.footer-logo-bg {
  padding: 4px 8px;
  border-radius: 8px;
}
.footer-logo-bg img {
  height: 32px;
  width: auto;
}

#page-loader .loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

#page-loader .loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
  animation: shimmer 1.2s ease-in-out infinite;
}

#page-loader .loader-text {
  color: var(--concrete);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Custom cursor — disabled */

/* ============================================================
   5. SCROLL PROGRESS BAR
   ============================================================ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-red-light), var(--gold));
  z-index: var(--z-scroll-progress);
  transition: width 0.1s linear;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* ============================================================
   6. GLASSMORPHISM
   ============================================================ */
.glass {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Service cards: solid white background in light mode for better visibility */
.service-card.glass {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.service-card.glass:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.glass-dark {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
}

[data-theme="dark"] .glass {
  background: rgba(10, 15, 30, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   7. NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: 1.25rem 0;
  transition: all var(--transition-base);
  background: transparent;
}

.navbar.scrolled {
  padding: 0.75rem 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid var(--border-color);
}

/* Desktop nav / mobile menu breakpoint at 1360px */
.desktop-nav { display: none !important; }
.mobile-menu-btn { display: block; }
.nav-quote-btn { display: none !important; }

@media (min-width: 1360px) {
  .desktop-nav { display: flex !important; }
  .mobile-menu-btn { display: none; }
  .nav-quote-btn { display: inline-flex !important; }
}

/* Navbar icon buttons (search, dark mode toggle) — always visible */
.navbar #search-toggle,
.navbar #dark-mode-toggle {
  color: #ffffff;
}

.navbar.scrolled #search-toggle,
.navbar.scrolled #dark-mode-toggle {
  color: var(--text);
}

[data-theme="dark"] .navbar.scrolled #search-toggle,
[data-theme="dark"] .navbar.scrolled #dark-mode-toggle {
  color: #e5e7eb;
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(10, 15, 30, 0.85);
}

.navbar .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.navbar .nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.navbar:not(.scrolled) .nav-logo {
  color: #ffffff;
}

.navbar.scrolled .nav-logo {
  color: #1a1a2e !important;
}

.navbar.scrolled .nav-logo .text-steel {
  color: #6b7280 !important;
}

.navbar:not(.scrolled) .nav-logo .text-steel {
  color: rgba(255, 255, 255, 0.7) !important;
}

.navbar:not(.scrolled) .nav-logo .nav-text-color {
  color: #ffffff !important;
}

[data-theme="dark"] .navbar.scrolled .nav-logo {
  color: #e5e7eb !important;
}

[data-theme="dark"] .navbar.scrolled .nav-logo .text-steel {
  color: #9ca3af !important;
}

.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.navbar .nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.navbar.scrolled .nav-link {
  color: #374151 !important;
}

.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active {
  color: var(--primary) !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.navbar:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.8);
}

.navbar:not(.scrolled) .nav-link:hover,
.navbar:not(.scrolled) .nav-link.active {
  color: #ffffff;
}

[data-theme="dark"] .navbar.scrolled .nav-link {
  color: #d1d5db !important;
}

[data-theme="dark"] .navbar.scrolled .nav-link:hover,
[data-theme="dark"] .navbar.scrolled .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.navbar .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-red);
  transition: width var(--transition-base);
  border-radius: var(--radius-full);
}

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

.navbar .nav-link:hover {
  color: var(--accent-red);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.navbar:not(.scrolled) .nav-toggle span {
  background: #ffffff;
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(85vw, 400px);
  height: 100dvh;
  background: var(--bg-surface);
  z-index: calc(var(--z-sticky) + 10);
  padding: 6rem 2rem 2rem;
  transition: right var(--transition-slow) cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sticky) + 5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu .mobile-nav-link {
  display: block;
  padding: 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  color: var(--text);
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.mobile-menu .mobile-nav-link:hover {
  color: var(--accent-red);
  padding-left: 0.5rem;
}

/* Mega Menu */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 600px;
  padding: 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

[data-theme="dark"] .mega-menu {
  background: rgba(17, 24, 39, 0.95);
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.mega-menu-item:hover {
  background: var(--bg-surface-alt);
}

.mega-menu-item .mega-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 1.25rem;
}

/* ============================================================
   8. HERO SECTION
   ============================================================ */
#hero {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--dark);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 15, 30, 0.4) 0%,
    rgba(10, 15, 30, 0.6) 50%,
    rgba(10, 15, 30, 0.9) 100%
  );
  z-index: 2;
}

[data-theme="dark"] #hero::after {
  background: linear-gradient(
    to bottom,
    rgba(10, 15, 30, 0.15) 0%,
    rgba(10, 15, 30, 0.3) 50%,
    rgba(10, 15, 30, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 var(--container-px);
}

.hero-content h1 {
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 4px 40px rgba(0, 0, 0, 0.5);
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
  margin-inline: auto;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.hero-stat .stat-number {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.hero-stat .stat-number .accent {
  color: var(--gold);
}

.hero-stat .stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Hero stat items — ensure visibility on any monitor */
#hero .stat-item {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

#hero .stat-item .text-gray-400 {
  color: rgba(255, 255, 255, 0.7) !important;
}

#hero .hero-cta a,
#hero .hero-cta button {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}

.hero-scroll-indicator .scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
}

/* ============================================================
   9. SECTION STYLES
   ============================================================ */
section {
  padding: var(--section-py) 0;
  position: relative;
}

.section-alt {
  background: var(--bg-surface-alt);
}

.section-dark {
  background: var(--dark);
  color: #ffffff;
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: #ffffff;
}

.section-dark p {
  color: rgba(255, 255, 255, 0.7);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  max-width: 700px;
  margin-inline: auto;
}

.section-header .section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-red);
  margin-bottom: 1rem;
}

.section-header .section-tag::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 3px;
  background: var(--accent-red);
  border-radius: var(--radius-full);
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  margin-inline: auto;
}

/* Section title with left accent */
.section-title-accented {
  position: relative;
  padding-left: 1.25rem;
}

.section-title-accented::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 4px;
  height: 1.2em;
  background: var(--accent-red);
  border-radius: var(--radius-full);
}

[dir="rtl"] .section-title-accented {
  padding-left: 0;
  padding-right: 1.25rem;
}

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

/* ============================================================
   10. SERVICE CARDS
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.service-card {
  position: relative;
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border-bottom: 3px solid transparent;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-bottom-color: var(--accent-red);
}

.service-card .service-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform var(--transition-base);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(-5deg);
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 0.92rem;
  line-height: 1.7;
}

.service-card .service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-red);
  transition: gap var(--transition-fast);
}

.service-card:hover .service-link {
  gap: 0.85rem;
}

/* ============================================================
   11. PROJECT CARDS
   ============================================================ */
.projects-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

/* Ensure project card gradient overlays are always fully visible */
.project-card > .absolute {
  opacity: 1 !important;
}

/* Stronger text contrast on project cards */
.project-card h3 {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  color: #ffffff !important;
}

.project-card p {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.project-card .text-gold {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Cards are always visible (GSAP removed) */
.project-card,
.service-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-card .project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.project-card .project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 15, 30, 0.95) 0%,
    rgba(10, 15, 30, 0.3) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-card .project-content {
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

.project-card:hover .project-content {
  transform: translateY(0);
}

.project-card .project-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent-red);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.project-card .project-title {
  font-size: 1.35rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.project-card .project-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
}

/* ============================================================
   12. TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Timeline line is created via HTML div, not pseudo-element */
.timeline::before {
  display: none;
}

/* Timeline items: use full width, let Tailwind flex handle layout */
.timeline-item {
  position: relative;
  width: 100%;
  padding: 0 0 0 0;
}

.timeline-item:nth-child(odd) {
  left: auto;
  text-align: left;
}

.timeline-item:nth-child(even) {
  left: auto;
  text-align: left;
}

/* Center timeline line and dots using margin (not transform, which GSAP overrides) */
@media (min-width: 768px) {
  .timeline-line {
    margin-left: -1px;
  }
  .timeline-dot {
    margin-left: -10px !important;
  }
}
@media (max-width: 767px) {
  .timeline-line {
    margin-left: -1px;
  }
  .timeline-dot {
    margin-left: -10px !important;
  }
}

.timeline-item:nth-child(odd) .timeline-dot {
  /* Position handled by Tailwind */
}

.timeline-item:nth-child(even) .timeline-dot {
  /* Position handled by Tailwind */
}

.timeline-item .timeline-content {
  padding: 1.75rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.timeline-item:hover .timeline-content {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.timeline-item .timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-item .timeline-content h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.timeline-item .timeline-content p {
  font-size: 0.9rem;
}

/* ============================================================
   13. CLIENT LOGOS (Marquee)
   ============================================================ */
.client-marquee-wrapper {
  overflow: hidden;
  padding: 2rem 0;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.client-marquee {
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
  padding: 2rem 0;
}

.client-marquee .animate-marquee {
  display: flex;
  width: max-content;
  animation: scroll 30s linear infinite;
}

/* ============================================================
   14. STATISTICS / COUNTERS
   ============================================================ */
.stats-section {
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 2rem 1rem;
}

.stat-item .stat-value {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.section-dark .stat-item .stat-value {
  color: #ffffff;
}

.stat-item .stat-value::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--accent-red);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.stat-item:hover .stat-value::after {
  width: 80%;
}

.stat-item .stat-value .stat-suffix {
  font-size: 0.6em;
  color: var(--gold);
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-dark .stat-item .stat-label {
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   15. DARK MODE TRANSITIONS
   ============================================================ */
body,
.navbar,
.service-card,
.project-card,
.timeline-item .timeline-content,
.stat-item,
footer,
input,
textarea,
select,
.btn-primary,
.btn-secondary,
.glass,
.glass-dark,
.mega-menu,
.mobile-menu,
.filter-btn {
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* Dark mode card adjustments */
[data-theme="dark"] .service-card {
  background: rgba(17, 24, 39, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .service-card:hover {
  box-shadow: 0 10px 40px rgba(193, 39, 45, 0.1);
}

[data-theme="dark"] .service-card .service-icon {
  box-shadow: 0 4px 15px rgba(30, 42, 94, 0.4);
}

[data-theme="dark"] .timeline-item .timeline-content {
  background: rgba(17, 24, 39, 0.8);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .timeline-item .timeline-dot {
  border-color: var(--dark);
}

[data-theme="dark"] .filter-btn {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

[data-theme="dark"] .section-alt {
  background: var(--bg-surface-alt);
}

/* ============================================================
   16. QUOTE MODAL
   ============================================================ */
#quote-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

#quote-modal.open {
  opacity: 1;
  visibility: visible;
}

#quote-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#quote-modal .modal-panel {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: clamp(2rem, 4vw, 3rem);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] #quote-modal .modal-panel {
  background: rgba(17, 24, 39, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

#quote-modal.open .modal-panel {
  transform: translateY(0) scale(1);
}

#quote-modal .modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-surface-alt);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

#quote-modal .modal-close:hover {
  background: var(--accent-red);
  color: #ffffff;
}

[dir="rtl"] #quote-modal .modal-close {
  right: auto;
  left: 1.25rem;
}

/* ============================================================
   17. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(30, 42, 94, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(30, 42, 94, 0.45);
}

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

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30, 42, 94, 0.04);
}

[data-theme="dark"] .btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-secondary:hover {
  border-color: var(--accent-red-light);
  color: var(--accent-red-light);
  background: rgba(193, 39, 45, 0.08);
}

.btn-quote {
  background: linear-gradient(135deg, var(--accent-red), var(--accent-red-light));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(193, 39, 45, 0.35);
}

.btn-quote:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(193, 39, 45, 0.45);
}

.btn-sm {
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 1rem 2.75rem;
  font-size: 1rem;
}

/* Ripple effect */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================
   18. FORM STYLES
   ============================================================ */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.form-control:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(193, 39, 45, 0.1);
}

[data-theme="dark"] .form-control {
  background: rgba(17, 24, 39, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(193, 39, 45, 0.15);
}

/* Floating Label */
.form-group .floating-label {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-fast);
  background: transparent;
  padding: 0 0.25rem;
}

[dir="rtl"] .form-group .floating-label {
  left: auto;
  right: 1.25rem;
}

.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
  top: -0.6rem;
  font-size: 0.75rem;
  color: var(--accent-red);
  background: var(--bg-surface);
}

[data-theme="dark"] .form-control:focus ~ .floating-label,
[data-theme="dark"] .form-control:not(:placeholder-shown) ~ .floating-label {
  background: var(--dark-surface);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

/* File Upload Drop Zone */
.file-drop-zone {
  position: relative;
  padding: 2.5rem 2rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--card-bg);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--accent-red);
  background: rgba(193, 39, 45, 0.04);
}

.file-drop-zone .drop-icon {
  font-size: 2.5rem;
  color: var(--steel);
  margin-bottom: 1rem;
}

.file-drop-zone .drop-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.file-drop-zone .drop-text strong {
  color: var(--accent-red);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ============================================================
   19. FOOTER
   ============================================================ */
footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.7);
  padding-top: 0;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-red), var(--gold), var(--accent-red), var(--primary));
  background-size: 200% 100%;
  animation: gradientShift 6s ease infinite;
}

.footer-main {
  padding: 5rem 0 3rem;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 300px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  position: relative;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--gold);
  padding-left: 0.35rem;
}

[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 0.35rem;
}

.footer-bottom {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.35);
}

.footer-socials {
  display: flex;
  gap: 0.75rem;
}

.footer-socials a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  transition: all var(--transition-base);
}

.footer-socials a:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
  transform: translateY(-3px);
}

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

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.8;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  50% {
    transform: translateY(-12px) translateX(-50%);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 100% {
    border-color: transparent;
  }
  50% {
    border-color: var(--accent-red);
  }
}

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

@keyframes shimmer {
  0% {
    left: -50%;
  }
  100% {
    left: 150%;
  }
}

/* ============================================================
   21. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ---- Tablet and below (< 1024px) ---- */
@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .mega-menu {
    min-width: 400px;
  }

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

  .hero-stats {
    gap: 2rem;
  }
}

/* ---- Mobile (< 768px) ---- */
@media (max-width: 768px) {
  .navbar .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

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

  .projects-grid {
    gap: 1.25rem;
  }

  .project-card {
    aspect-ratio: 16 / 10;
  }

  .project-card .project-overlay {
    opacity: 1;
  }

  .project-card .project-content {
    transform: translateY(0);
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Timeline stacks on mobile - handled by Tailwind responsive classes */

  .hero-content h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

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

  .hero-buttons .btn {
    justify-content: center;
  }

  .mega-menu {
    display: none;
  }

  .section-header {
    text-align: left;
  }

  .section-header .section-tag::before {
    display: none;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .projects-filter {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .projects-filter::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
  }
}

/* ---- Small mobile (< 480px) ---- */
@media (max-width: 480px) {
  :root {
    --section-py: 3rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .stat-item .stat-value {
    font-size: 2rem;
  }
}

/* ============================================================
   22. UTILITY CLASSES
   ============================================================ */

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal.reveal-left {
  transform: translateX(-30px);
}

.reveal.reveal-left.active {
  transform: translateX(0);
}

.reveal.reveal-right {
  transform: translateX(30px);
}

.reveal.reveal-right.active {
  transform: translateX(0);
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent-red-light), var(--gold));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 5s ease infinite;
}

/* Grid Background Pattern */
.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(30, 42, 94, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 42, 94, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

[data-theme="dark"] .bg-grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Section Divider */
.section-divider {
  position: relative;
}

.section-divider::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
  z-index: 1;
}

[data-theme="dark"] .section-divider::after {
  background: var(--dark);
}

.section-divider-top::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 100%);
  z-index: 1;
}

/* Parallax Background */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (prefers-reduced-motion: reduce) {
  .parallax-bg {
    background-attachment: scroll;
  }
}

/* Hover Lift */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ============================================================
   23. SPECIAL EFFECTS
   ============================================================ */

/* Noise Texture Overlay */
.noise-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Diagonal Section Dividers (clip-path) */
.clip-diagonal-top {
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
}

.clip-diagonal-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
}

.clip-diagonal-both {
  clip-path: polygon(0 5%, 100% 0, 100% 95%, 0 100%);
}

/* Text Shadow for Hero Headings */
.hero-text-shadow {
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.3),
    0 8px 40px rgba(0, 0, 0, 0.2);
}

/* Box Shadows Hierarchy */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Glow effect */
.glow-red {
  box-shadow: 0 0 20px rgba(193, 39, 45, 0.3), 0 0 60px rgba(193, 39, 45, 0.1);
}

.glow-primary {
  box-shadow: 0 0 20px rgba(30, 42, 94, 0.3), 0 0 60px rgba(30, 42, 94, 0.1);
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-red);
  animation:
    typewriter 3s steps(40) 1s forwards,
    blink 0.75s step-end infinite;
  width: 0;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  z-index: var(--z-overlay);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-red);
  transform: translateY(-3px);
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .client-marquee {
    animation: none;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .cursor-dot,
  .cursor-outline,
  #scroll-progress,
  #page-loader,
  .back-to-top,
  footer {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ============================================================
   SPINNER & FORM SUCCESS
   ============================================================ */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 0.75rem;
  color: #4ade80;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-success svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ============================================================
   CLIENT LOGOS MARQUEE
   ============================================================ */

/* Pause marquee on hover */
.client-marquee:hover .animate-marquee {
  animation-play-state: paused !important;
}

/* Logo wrapper — white rounded card in dark mode */
.client-logo-wrap {
  cursor: pointer;
  border-radius: 1rem;
  margin: 0;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              margin 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.5s ease,
              background 0.5s ease;
}

[data-theme="dark"] .client-logo-wrap {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1rem;
}

/* Logo base style */
.client-logo {
  opacity: 0.9;
  transition: opacity 0.6s ease;
}

/* Hover: smooth scale with gentle margin push */
.client-logo-wrap:hover {
  transform: scale(1.25);
  margin: 0 1.5rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 1rem;
}

.client-logo-wrap:hover .client-logo {
  opacity: 1;
  filter: none;
}

[data-theme="dark"] .client-logo-wrap:hover {
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}

/* Light mode: slight contrast boost */
[data-theme="light"] .client-logo {
  filter: brightness(0.85) contrast(1.2) saturate(1.3);
}

/* Dark mode: no filter needed — white card handles visibility */
[data-theme="dark"] .client-logo {
  filter: none;
  opacity: 1;
}
