/* IHS Enterprises Pty Ltd - Keyframe Animations & Motion Effects */

/* 1. Page Loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

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

.loader-logo {
  animation: logo-pulse 1.8s ease-in-out infinite alternate;
}

@keyframes logo-pulse {
  0% { transform: scale(0.96); filter: drop-shadow(0 0 12px rgba(0, 214, 143, 0.3)); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 35px rgba(0, 214, 143, 0.85)); }
}

.loader-bar-wrap {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.loader-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d68f, #33deb0);
  box-shadow: 0 0 10px #00d68f;
  transition: width 0.4s ease;
  animation: loader-anim 1.6s ease-in-out forwards;
}

@keyframes loader-anim {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* 2. Hero Animated Background & Car Parallax - digitaltenx.qa deep glow & subtle grid */
.hero-glow-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(60% 60% at 50% 0%, rgba(0, 214, 143, 0.16) 0%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 80px 80px, 80px 80px;
  background-position: top;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(85% 80% at 50% 0%, #000 30%, transparent 85%);
  mask-image: radial-gradient(85% 80% at 50% 0%, #000 30%, transparent 85%);
}

.hero-car-floating {
  animation: float-car 6s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes float-car {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(0.4deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

/* 3. Word Reveal Headline Effect */
.word-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.word-reveal span {
  display: inline-block;
  transform: translateY(110%);
  animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reveal-up {
  to { transform: translateY(0%); }
}

/* Scroll indicator bounce */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: scroll-bounce 2s infinite ease-in-out;
  cursor: pointer;
  z-index: 2;
}

@keyframes scroll-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -10px); }
  60% { transform: translate(-50%, -5px); }
}

.marquee-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  contain: paint;
  padding: 1.75rem 0;
  background: rgba(17, 22, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 15%, black 85%, transparent 100%);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.marquee-item:hover {
  color: var(--primary);
}

.marquee-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* 5. Process Timeline Line Drawing */
.timeline-wrap {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.timeline-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #00d68f 0%, #00976a 100%);
  box-shadow: 0 0 12px rgba(0, 214, 143, 0.6);
  border-radius: 2px;
  transition: height 0.2s ease-out;
}

.timeline-step {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  position: relative;
  z-index: 2;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.timeline-node {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-light);
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.timeline-step.active .timeline-node {
  background: #080d0d;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 25px rgba(0, 214, 143, 0.4);
  transform: scale(1.1);
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.85rem 2.2rem;
  flex-grow: 1;
  transition: all var(--transition-normal);
}

.timeline-step.active .timeline-content {
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateX(6px);
}

.timeline-step-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-step-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .timeline-step { gap: 1.25rem; }
  .timeline-line { left: 22px; }
  .timeline-node { width: 46px; height: 46px; font-size: 0.95rem; }
  .timeline-content { padding: 1.25rem 1.4rem; }
  .timeline-step.active .timeline-content {
    transform: none;
  }
}

@media (max-width: 420px) {
  .timeline-step { gap: 0.85rem; margin-bottom: 2.5rem; }
  .timeline-line { left: 17px; }
  .timeline-node { width: 36px; height: 36px; font-size: 0.825rem; }
  .timeline-content { padding: 1rem; }
  .timeline-step-title { font-size: 1.15rem; }
}

/* 6. General Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.reveal-scale {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Stagger sequence helper */
.stagger-grid > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.stagger-grid.revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-grid.revealed > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.stagger-grid.revealed > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
.stagger-grid.revealed > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
.stagger-grid.revealed > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
.stagger-grid.revealed > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* 7. Animated Counter */
.stat-counter {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-4xl);
  color: var(--primary);
  line-height: 1.1;
  display: block;
}

/* 8. Desktop Cursor Glow Effect */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 214, 143, 0.08) 0%, transparent 68%);
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.08s ease-out;
}

@media (hover: none) or (max-width: 1024px) {
  .cursor-glow { display: none; }
}

/* 9. Accessibility: Respect 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 !important;
    transform: none !important;
  }
  .word-reveal span {
    transform: none !important;
  }
  .marquee-track {
    animation: none !important;
  }
  .hero-car-floating {
    animation: none !important;
  }
  .page-loader {
    display: none !important;
  }
}
