:root {
  --navy: #152238;
  --navy-deep: #0e1a2e;
  --blue-primary: #275087;
  --blue-mid: #497BBE;
  --blue-light: #79ACF0;
  --green-primary: #4CBA70;
  --green-mid: #6BB884;
  --green-light: #B3E7C4;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-100: #f1f3f8;
  --gray-200: #e2e6ef;
  --gray-400: #8b95a8;
  --gray-600: #5a6577;
  --text-dark: #152238;
  --text-body: #4a5568;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 60px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
}

.nav.scrolled {
  background: rgba(21, 34, 56, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 40px rgba(0, 0, 0, 0.15);
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 38px;
  width: auto;
}

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

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown > a::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.3s;
}

.nav-dropdown:hover > a::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(21, 34, 56, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 0;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  list-style: none;
}

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

.dropdown-menu li a {
  display: block;
  padding: 10px 24px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: none;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s;
}

.dropdown-menu li a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-menu li a.dropdown-active {
  color: var(--green-light);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 24px;
}

.nav-cta {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--green-primary) 0%, var(--green-mid) 50%, var(--blue-mid) 100%) !important;
  border: none;
  border-radius: 6px;
  color: var(--white) !important;
  font-weight: 700 !important;
  transition: all 0.3s !important;
  box-shadow: 0 2px 12px rgba(76, 186, 112, 0.3);
  text-decoration: none;
}

.nav-cta:hover {
  color: var(--white) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(76, 186, 112, 0.4);
  filter: brightness(1.08);
}

/* Center FAQ heading */
.faq-section > .section-label,
.faq-section > .section-title {
  text-align: center;
}

/* ===== RESPONSIVE QA GUARDRAILS ===== */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.hero {
  max-width: 100vw;
  overflow: hidden !important;
}

.hero-text-bg {
  left: 50% !important;
  right: auto !important;
  width: 100vw !important;
  max-width: 100vw !important;
  transform: translateX(-50%) rotate(-4deg) !important;
  overflow: hidden !important;
}

.hero-text-bg-row {
  max-width: 100vw;
}

.service-detail,
.service-detail > *,
.service-content,
.service-visual-card {
  min-width: 0;
  max-width: 100%;
}

.carousel-track-wrapper,
.logo-carousel {
  max-width: 100%;
  overflow: hidden !important;
  contain: layout paint;
}

.optix-glow {
  max-width: 100%;
  overflow: hidden;
}

.about-grid,
.about-content,
.about-visual,
.about-features {
  min-width: 0;
  max-width: 100%;
}

.about,
.services,
.stats,
.optix-section,
.why-nexus,
.process,
.cta-section,
.empathy-section,
.logo-bar {
  max-width: 100%;
  overflow: hidden !important;
}

@media (max-width: 768px) {
  .service-detail {
    width: 100%;
  }

  .carousel-track-wrapper {
    max-width: 100vw;
    contain: layout paint;
  }

  .about-grid,
  .about-content,
  .about-visual,
  .about-features {
    width: 100%;
    transform: none !important;
  }
}

@media (max-width: 1200px) {
  .hero-text-bg {
    display: none !important;
  }

  .carousel-track {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 24px !important;
    transform: none !important;
    animation: none !important;
  }

  .carousel-logo {
    min-width: 0 !important;
  }

  .carousel-logo:nth-child(n + 9) {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .carousel-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px !important;
    padding: 0 20px !important;
  }

  .mini-chart .bar {
    min-width: 0 !important;
  }

  .optix-glow {
    display: none !important;
  }

  .rotate-line,
  .rotate-wrapper {
    max-width: 100%;
    contain: layout paint;
  }

  .rotate-word:not(.active) {
    visibility: hidden;
    transform: translateX(0) !important;
  }
}
