/* ========================================
   FREEMIUMS – Premium Animations & Effects
   Particle backgrounds, counters, tilt cards,
   gradient text, marquee logos, cursor glow
   ======================================== */

/* ── Animated Gradient Background on Hero ── */
.hero--immersive {
  background: linear-gradient(-45deg, #0a1f44, #122d5e, #2167ae, #185a96, #0a1f44);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

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

/* ── Particle Dots Canvas Container ── */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: particleFloat var(--duration) ease-in-out infinite var(--delay);
}

@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
  25% { transform: translate(var(--dx1), var(--dy1)) scale(1.5); opacity: 0.35; }
  50% { transform: translate(var(--dx2), var(--dy2)) scale(1); opacity: 0.2; }
  75% { transform: translate(var(--dx3), var(--dy3)) scale(1.3); opacity: 0.3; }
}

/* ── Gradient Text on Section Headings ── */
.gradient-text {
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text--light {
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glowing Buttons ── */
.btn--glow {
  position: relative;
  z-index: 1;
}

.btn--glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--green), var(--accent));
  background-size: 200% 200%;
  animation: glowRotate 3s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.btn--glow:hover::before {
  opacity: 1;
}

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

/* ── 3D Tilt Cards ── */
.tilt-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.tilt-card:hover {
  box-shadow: 0 25px 60px rgba(10, 31, 68, 0.2),
              0 0 30px rgba(33, 103, 174, 0.1);
}

/* ── Gradient Border Cards ── */
.gradient-border {
  position: relative;
  background: var(--white);
  border: none !important;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--green), var(--accent));
  background-size: 200% 200%;
  animation: glowRotate 4s linear infinite paused;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gradient-border:hover::before {
  opacity: 1;
  animation-play-state: running;
}

/* ── Wave Section Dividers ── */
.wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-top: -1px;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

.wave-divider--flip {
  transform: rotate(180deg);
  margin-top: 0;
  margin-bottom: -1px;
}

/* ── Animated Logo Marquee ── */
.logo-marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.logo-marquee__track {
  display: flex;
  gap: 120px;
  align-items: center;
  animation: marqueeScroll 30s linear infinite;
  width: max-content;
}

.logo-marquee__track img {
  height: 160px;
  object-fit: contain;
  opacity: 0.85;
  transition: all 0.4s ease;
  flex-shrink: 0;
}

.logo-marquee__track img:hover {
  opacity: 1;
  transform: scale(1.1);
}

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

/* ── Animated Counter Numbers ── */
.counter-animated {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── Floating Badge Pulse ── */
.badge-pulse {
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(106, 182, 72, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(106, 182, 72, 0); }
}

/* ── Smooth Section Color Transitions ── */
.section--gradient-1 {
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
}

.section--gradient-2 {
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.section--gradient-dark {
  background: linear-gradient(135deg, var(--navy) 0%, #122d5e 50%, var(--accent-dark) 100%);
}

/* ── Animated Wave Gradient for All Sections ── */
.section--gray {
  background: linear-gradient(-45deg, 
    rgba(33, 103, 174, 0.07),
    rgba(106, 182, 72, 0.07),
    rgba(33, 103, 174, 0.04),
    rgba(106, 182, 72, 0.09),
    rgba(33, 103, 174, 0.07)) !important;
  background-size: 400% 400% !important;
  animation: waveGradient 10s ease infinite;
}

.section:not(.section--gray):not(.section--navy) {
  background: linear-gradient(-45deg, 
    rgba(33, 103, 174, 0.03),
    rgba(106, 182, 72, 0.03),
    rgba(33, 103, 174, 0.015),
    rgba(106, 182, 72, 0.04),
    rgba(33, 103, 174, 0.03));
  background-size: 400% 400%;
  animation: waveGradient 12s ease infinite;
}

.journey {
  background: linear-gradient(-45deg, 
    rgba(33, 103, 174, 0.03),
    rgba(106, 182, 72, 0.04),
    rgba(33, 103, 174, 0.02),
    rgba(106, 182, 72, 0.05),
    rgba(33, 103, 174, 0.03));
  background-size: 400% 400%;
  animation: waveGradient 14s ease infinite;
}

@keyframes waveGradient {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 25%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 0% 75%; }
  100% { background-position: 0% 50%; }
}

/* ── Animated Underline Links ── */
.link-animated {
  position: relative;
  display: inline-block;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.link-animated:hover::after {
  width: 100%;
}

/* ── Smooth Text Reveal (for hero) ── */
.text-reveal {
  overflow: hidden;
}

.text-reveal > * {
  transform: translateY(100%);
  animation: textRevealUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.text-reveal > *:nth-child(2) { animation-delay: 0.15s; }
.text-reveal > *:nth-child(3) { animation-delay: 0.3s; }
.text-reveal > *:nth-child(4) { animation-delay: 0.45s; }

@keyframes textRevealUp {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ── Interactive Hover Lift on Feature Icons ── */
.feature__icon {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature:hover .feature__icon {
  transform: translateY(-6px) scale(1.1);
  background: rgba(33, 103, 174, 0.15);
  box-shadow: 0 8px 20px rgba(33, 103, 174, 0.15);
}

/* ── Journey Step Enhanced Animations ── */
.journey__step {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey__step:hover {
  transform: translateY(-8px);
}

/* ── Service Card Gradient Overlay on Hover ── */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(33, 103, 174, 0.03), transparent);
  transition: left 0.6s ease;
}

.service-card:hover::after {
  left: 100%;
}

/* ── Stats Glow Effect ── */
.stat__number {
  transition: all 0.4s ease;
}

.stat:hover .stat__number {
  text-shadow: 0 0 24px rgba(33, 103, 174, 0.3);
  transform: scale(1.05);
}

/* ── Process Step Bounce ── */
.process__number {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.process__step:hover .process__number {
  transform: scale(1.15);
  box-shadow: 0 8px 24px rgba(33, 103, 174, 0.3);
}

/* ── Enhanced Case Study Hover ── */
.case-study__metric {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.case-study__metric:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(10, 31, 68, 0.08);
  background: rgba(33, 103, 174, 0.08);
}

/* ── Cursor Follow Glow (for hero) ── */
.cursor-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33, 103, 174, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 0.3s ease, top 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.hero--immersive:hover .cursor-glow {
  opacity: 1;
}

/* ── Frosted Glass Navigation ── */
.nav {
  background: rgba(255, 255, 255, 1) !important;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

/* ── Mail Journey Road Scene ── */
.journey-scene {
  position: relative;
  margin: 40px 0 20px;
  padding: 0 24px;
}

.journey-road {
  position: relative;
  height: 160px;
}

.journey-road__line {
  position: absolute;
  bottom: 20px;
  left: 3%;
  right: 3%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--green), #FFD700, var(--accent));
  border-radius: 2px;
}

/* ── Multi-Character Traveler ── */
.journey-traveler {
  position: absolute;
  bottom: 28px;
  left: 3%;
  z-index: 10;
  transition: left 0.08s linear;
}

.journey-char {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scale(0.7);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.journey-char.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Landmark Labels ── */
.journey-landmark {
  position: absolute;
  bottom: -32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  z-index: 5;
}

.journey-landmark__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.4s ease, transform 0.3s ease;
}

.journey-landmark__label.passed {
  color: var(--green);
  transform: scale(1.05);
}

/* ── Progress Dots ── */
.journey-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
}

.journey-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfd8e3;
  border: 2px solid #fff;
  transform: translateX(-50%);
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 6;
}

.journey-dot.reached {
  background: var(--green);
  box-shadow: 0 0 12px rgba(106, 182, 72, 0.6);
  transform: translateX(-50%) scale(1.35);
}

/* ── Loop-back Arrow ── */
.journey-loop {
  position: relative;
  margin-top: 44px;
  text-align: center;
}

.journey-loop__arrow {
  width: 100%;
  max-width: 700px;
  height: 60px;
  margin: 0 auto;
  display: block;
}

.journey-loop__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* ── Journey Scene Mobile: Hidden (uses animated mobile flow instead) ── */
@media (max-width: 768px) {
  .journey-scene {
    display: none !important;
  }
  .journey-loop {
    display: none !important;
  }
}



/* ── Case Studies Carousel ── */
.cs-carousel {
  position: relative;
  margin-top: 48px;
  overflow: hidden;
}

.cs-carousel__track {
  position: relative;
  min-height: 420px;
}

.cs-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.cs-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  position: relative;
}

.cs-slide__content {
  padding: 8px 0;
}

.cs-slide__badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.cs-slide__title {
  color: #fff;
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 20px;
}

.cs-slide__challenge, .cs-slide__solution {
  margin-bottom: 16px;
}

.cs-slide__challenge h4, .cs-slide__solution h4 {
  color: var(--green);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.cs-slide__challenge p, .cs-slide__solution p {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  line-height: 1.6;
}

.cs-slide__results {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-slide__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cs-metric {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.cs-metric:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--green);
  transform: translateY(-4px);
}

.cs-metric__before {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}

.cs-metric__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
  margin-bottom: 4px;
}

.cs-metric__label {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cs-slide__roi {
  background: linear-gradient(135deg, rgba(106, 182, 72, 0.15), rgba(33, 103, 174, 0.15));
  border: 1px solid rgba(106, 182, 72, 0.25);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.cs-roi__number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}

.cs-roi__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.cs-roi__note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
}

/* Carousel Nav Buttons */
.cs-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.cs-carousel__btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--green);
}

.cs-carousel__btn--prev { left: -56px; }
.cs-carousel__btn--next { right: -56px; }

/* Carousel Dots */
.cs-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.cs-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.cs-dot.active {
  background: var(--green);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(106, 182, 72, 0.4);
}

@media (max-width: 768px) {
  .cs-slide {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cs-carousel__btn--prev { left: -8px; }
  .cs-carousel__btn--next { right: -8px; }
  .cs-slide__metrics {
    grid-template-columns: 1fr;
  }
}

/* ── Contact Page: Reduce Hero Whitespace ── */
.hero--centered .hero__inner {
  padding-bottom: 0;
}

/* ── Responsive: reduce motion for large animations ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
