/* ==========================================================================
   MS CHANDRAGUPT CONSTRUCTION — ANIMATIONS & MICRO-INTERACTIONS
   High-performance GPU-accelerated transitions & blueprint motion system
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. KEYFRAME DEFINITIONS
   -------------------------------------------------------------------------- */

/* Smooth Reveal Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reveal From Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Reveal From Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Gentle Scale In */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Blueprint Grid Scanning Laser Effect */
@keyframes blueprintScan {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* Subtle Shimmer for Cards & Highlights */
@keyframes shimmerGlow {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Pulse Glow for Construction Badges */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(39, 184, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(39, 184, 241, 0);
  }
}

/* Floating Architectural Geometric Shapes */
@keyframes floatSubtle {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

/* Text Highlight Sweep for Key Words */
@keyframes highlightSweep {
  0% {
    background-size: 0% 100%;
  }
  100% {
    background-size: 100% 100%;
  }
}

/* Rotate Loader / Spinner */
@keyframes spinClockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   2. SCROLL REVEAL UTILITY CLASSES (Driven by IntersectionObserver)
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.93);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* Triggered state */
.reveal.is-revealed,
.reveal-left.is-revealed,
.reveal-right.is-revealed,
.reveal-scale.is-revealed {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger Delays for Grids and Sequences */
.delay-100 { transition-delay: 0.1s; }
.delay-150 { transition-delay: 0.15s; }
.delay-200 { transition-delay: 0.2s; }
.delay-250 { transition-delay: 0.25s; }
.delay-300 { transition-delay: 0.3s; }
.delay-350 { transition-delay: 0.35s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* --------------------------------------------------------------------------
   3. HERO SPECIAL MICRO-ANIMATIONS
   -------------------------------------------------------------------------- */

.hero-heading .highlight-tomorrow {
  background: linear-gradient(120deg, rgba(39, 184, 241, 0.15), rgba(39, 184, 241, 0.28));
  background-repeat: no-repeat;
  background-size: 100% 30%;
  background-position: 0 88%;
  transition: all 0.4s ease;
}

.hero-heading .highlight-tomorrow:hover {
  background-size: 100% 90%;
  color: #FFFFFF;
}

.hero-diagonal-shape {
  animation: floatSubtle 9s ease-in-out infinite;
}

.hero-diagonal-shape-2 {
  animation: floatSubtle 11s ease-in-out infinite reverse;
}

/* Script tag handwriting hover */
.hero-script-tag span {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.hero-script-tag:hover span:nth-child(1) {
  transform: rotate(0deg) scale(1.05);
  color: var(--cyan);
}
.hero-script-tag:hover span:nth-child(2) {
  transform: rotate(2deg) scale(1.05);
}
.hero-script-tag:hover span:nth-child(3) {
  transform: rotate(-2deg) scale(1.1);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   4. STATS COUNTER PULSE & PROGRESS
   -------------------------------------------------------------------------- */

.stat-counter {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.stat-item:hover .stat-counter {
  color: var(--primary-blue);
}

.stat-icon-wrap {
  position: relative;
  overflow: hidden;
}

.stat-icon-wrap::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-item:hover .stat-icon-wrap::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   5. CARD HOVER & SHIMMER EFFECTS
   -------------------------------------------------------------------------- */

.service-card,
.project-card,
.why-reason-card {
  will-change: transform, box-shadow;
}

/* Shimmer highlight line on service cards */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  transform: skewX(-25deg);
  pointer-events: none;
  z-index: 5;
  transition: none;
}

.service-card:hover::before {
  left: 150%;
  transition: left 0.85s ease-in-out;
}

/* Project Card Image Zoom & Overlay Hint */
.project-img-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 40%, rgba(6, 61, 115, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.project-card:hover .project-img-box::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   6. BLUEPRINT GRID ANIMATION (Why Choose Us)
   -------------------------------------------------------------------------- */

.blueprint-grid-overlay {
  animation: blueprintScan 60s linear infinite;
}

/* Badge Pulse */
.pulse-badge {
  animation: pulseGlow 2.5s infinite;
}

/* --------------------------------------------------------------------------
   7. BUTTON MICRO-ANIMATIONS & SHINE
   -------------------------------------------------------------------------- */

.btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.btn:hover::before {
  left: 100%;
  transition: left 0.65s ease;
}

/* --------------------------------------------------------------------------
   9. NEW ATTRACTIVE TEXT & WEBSITE ANIMATIONS
   -------------------------------------------------------------------------- */

/* Kinetic Typing / Cycling Ticker Badge */
.hero-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(6, 61, 115, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(39, 184, 241, 0.4);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan);
  animation: pulseGlow 1.8s infinite;
  flex-shrink: 0;
}

.ticker-text {
  position: relative;
  min-height: 1.4em;
  display: inline-block;
  color: #FFFFFF;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Luminous Kinetic Gradient Flow for Titles & Keywords */
.text-gradient-flow {
  background: linear-gradient(
    90deg,
    #27B8F1 0%,
    #159FE3 25%,
    #FFFFFF 50%,
    #159FE3 75%,
    #27B8F1 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShineFlow 4s linear infinite;
  display: inline-block;
}

@keyframes textShineFlow {
  to {
    background-position: 200% center;
  }
}

/* Blueprint Laser Scanning Line under Section Titles */
.laser-scan-container {
  position: relative;
  width: 100%;
  max-width: 140px;
  height: 3px;
  background: rgba(8, 117, 201, 0.14);
  margin-top: 10px;
  margin-bottom: 16px;
  border-radius: 2px;
  overflow: hidden;
}

.section-header.text-center .laser-scan-container {
  margin-left: auto;
  margin-right: auto;
}

.laser-scan-line {
  position: absolute;
  top: 0;
  left: -35%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--bright-blue), transparent);
  box-shadow: 0 0 10px var(--cyan);
  animation: laserScanSweep 3.2s ease-in-out infinite;
}

@keyframes laserScanSweep {
  0% { left: -45%; }
  50% { left: 100%; }
  100% { left: -45%; }
}

/* 3D Tilt Card with Luminous Cyan Hover Edge */
.tilt-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease;
}

.tilt-card:hover {
  border-color: rgba(39, 184, 241, 0.8) !important;
  box-shadow: 0 14px 34px rgba(8, 117, 201, 0.2), 0 0 18px rgba(39, 184, 241, 0.22) !important;
}

/* Engineering Measuring Accents */
.measure-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 11px;
  color: var(--primary-blue);
  background: rgba(8, 117, 201, 0.08);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px dashed rgba(8, 117, 201, 0.3);
}

/* --------------------------------------------------------------------------
   7. HERO BANNER SLIDESHOW & FIELD MEDIA ANIMATIONS
   -------------------------------------------------------------------------- */

/* Ken Burns Subtle Cinematic Zoom */
@keyframes kenBurnsZoom {
  0% {
    transform: scale(1.04) translate(0, 0);
  }
  50% {
    transform: scale(1.12) translate(-0.8%, -0.8%);
  }
  100% {
    transform: scale(1.08) translate(0.5%, 0.5%);
  }
}

/* Red Live Footage Blinking Dot */
@keyframes liveDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* Video Play Button Glowing Ring Radar */
@keyframes playRingRadar {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(39, 184, 241, 0.6);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px rgba(39, 184, 241, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(39, 184, 241, 0);
  }
}

/* Fade Slide Transitions */
@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------------------
   8. ACCESSIBILITY / 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,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}
