/* ===================================================================
   EASYNAUKRI4U: 4-Step Selection Journey / Methodology
   Advanced Cinematic Animation & Interactive Experience
   - Preserves lavender background (#e9e2ff), black typography, 4 cards
   - Scroll-synchronized timeline with lime-green progress line & glowing pulse
   - Living ambient depth with floating lime/violet light forms & node spotlight
   - Kinetic masked typography reveals & line-draw accents
   - Interactive 3D card tilt with cursor-following lime spotlight
   - Fully responsive, hardware-accelerated, reduced-motion compliant
   =================================================================== */

.steps,
#methodology.steps {
  --ink: #191c18;
  --bg: #fafbf6;
  --muted: #596153;
  --cyan: #caf34c;
  --lime: #caf34c;
  --line: #ccd1c4;
  position: relative;
  overflow: hidden;
  background-color: #e9e2ff !important;
  background-image:
    radial-gradient(circle at 50% var(--bg-spot-y, 35%), rgba(202, 243, 76, calc(0.12 + var(--route-progress, 0) * 0.16)) 0%, rgba(233, 226, 255, 0.92) 48%, #dfd4fa 100%),
    linear-gradient(rgba(25, 28, 24, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 28, 24, 0.03) 1px, transparent 1px) !important;
  background-size: 100% 100%, 36px 36px, 36px 36px !important;
  padding: 95px 7% 105px !important;
  transition: background-color 0.8s ease;
  isolation: isolate;
  --route-progress: 0;
  --active-x: 12.5%;
}

/* ================= Living Ambient Background & Depth ================= */
.steps-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.steps-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  will-change: transform;
  pointer-events: none;
}

.steps-orb--lime {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(202, 243, 76, 0.5) 0%, rgba(202, 243, 76, 0) 70%);
  top: -80px;
  left: 8%;
  animation: floatOrbLime 20s ease-in-out infinite alternate;
  transform: translate3d(0, calc(var(--parallax-y, 0px) * -0.35), 0);
}

.steps-orb--violet {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.45) 0%, rgba(167, 139, 250, 0) 70%);
  bottom: -100px;
  right: 5%;
  animation: floatOrbViolet 24s ease-in-out infinite alternate;
  transform: translate3d(0, calc(var(--parallax-y, 0px) * 0.3), 0);
}

@keyframes floatOrbLime {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(60px, 40px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 70px, 0) scale(0.95); }
}

@keyframes floatOrbViolet {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-50px, -45px, 0) scale(1.06); }
  100% { transform: translate3d(40px, -60px, 0) scale(0.96); }
}

/* Soft radial glow following the currently active timeline node */
.steps-node-spotlight {
  position: absolute;
  top: 155px;
  left: var(--active-x, 12.5%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(202, 243, 76, 0.5) 0%, rgba(202, 243, 76, 0) 72%);
  filter: blur(48px);
  pointer-events: none;
  transition: left 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: calc(var(--route-progress, 0) > 0.03 ? 0.95 : 0);
  z-index: 0;
}

/* ================= Typography & Section Header Choreography ================= */
.steps .label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
  font-family: 'Space Grotesk', Manrope, sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 2px !important;
  color: #405720 !important;
  margin-bottom: 12px;
  transition: opacity 0.5s ease;
}

.steps .label::after {
  content: "";
  display: inline-block;
  width: 42px;
  height: 2px;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}

.steps.in-view .label::after {
  transform: scaleX(1);
}

.steps h2 {
  font-family: 'Barlow Condensed', Impact, sans-serif !important;
  font-size: clamp(48px, 6.5vw, 84px) !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: -1.5px !important;
  line-height: 0.96 !important;
  color: var(--ink) !important;
  position: relative;
  z-index: 2;
  margin-top: 14px;
  margin-bottom: 0;
}

/* Word-by-word kinetic upward entrance */
.steps-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 4px;
  margin-right: 0.24em;
}

.steps-word {
  display: inline-block;
  transform: translateY(115%);
  opacity: 0;
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.steps.in-view .steps-word {
  transform: translateY(0);
  opacity: 1;
}

/* Stagger delay for heading words */
.steps.in-view .steps-word--1 { transition-delay: 0.10s; }
.steps.in-view .steps-word--2 { transition-delay: 0.18s; }
.steps.in-view .steps-word--3 { transition-delay: 0.26s; }

/* Subtitle italic line draw reveal */
.steps h2 em {
  font-family: 'Source Serif 4', Georgia, serif !important;
  font-size: 0.82em !important;
  font-style: italic !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: -2px !important;
  color: var(--ink) !important;
  position: relative;
  display: inline-block;
}

.steps h2 em::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 100%;
  height: 3px;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.42s;
}

.steps.in-view h2 em::after {
  transform: scaleX(1);
}

/* ================= Animated Progress Timeline ================= */
.steps-grid {
  position: relative;
  isolation: isolate;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 28px !important;
  padding-top: 55px !important;
  margin-top: 45px !important;
  z-index: 2;
}

/* Outer track: Crisp white casing with black outline */
.steps-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

/* Active progress line: Vivid lime green with black borders & glow */
.steps-grid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--cyan, #caf34c);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(var(--route-progress, 0));
  box-shadow: 0 0 14px rgba(202, 243, 76, 0.85), 0 0 2px var(--ink);
  transition: transform 0.12s linear;
  z-index: 2;
}

/* Animated glowing particle at the tip of the progress bar */
.steps-timeline-head {
  position: absolute;
  top: -6px;
  left: calc(var(--route-progress, 0) * 100%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan, #caf34c);
  border: 2px solid var(--ink);
  box-shadow: 0 0 12px #caf34c, 0 0 22px rgba(202, 243, 76, 0.95);
  transform: translate(-50%, 0) scale(calc(var(--route-progress, 0) > 0.01 ? 1 : 0));
  transition: left 0.12s linear, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 6;
}

.steps-timeline-head::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan, #caf34c);
  opacity: 0.7;
  animation: pulseHeadRing 1.6s infinite ease-out;
}

@keyframes pulseHeadRing {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Suppress desktop connector stems and duplicate nodes to match exact screenshot design */
.steps-grid article::before,
.steps-grid article::after {
  display: none !important;
}

/* ================= 4-Card Entrance & 3D Interactive Architecture ================= */
.steps-grid article {
  padding: 30px 24px 34px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 6px 8px 0 var(--ink) !important;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform, box-shadow, opacity;
  opacity: 1;
  transition: 
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  z-index: 2;
}

/* Card revealed state */
.steps-grid article.step-revealed,
.steps-grid article.step-reached {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* Active current card highlight */
.steps-grid article.step-current {
  background: #ffffff !important;
  border-color: var(--ink) !important;
  box-shadow: 8px 10px 0 var(--ink) !important;
}

/* Final step (Card 4) celebratory completion glow pulse */
.steps-grid article:nth-child(4).step-reached {
  box-shadow: 6px 8px 0 var(--ink), 0 0 30px rgba(202, 243, 76, 0.5) !important;
  animation: finalStepPulse 3.5s infinite ease-in-out;
}

@keyframes finalStepPulse {
  0%, 100% {
    box-shadow: 6px 8px 0 var(--ink), 0 0 20px rgba(202, 243, 76, 0.4) !important;
  }
  50% {
    box-shadow: 6px 8px 0 var(--ink), 0 0 38px rgba(202, 243, 76, 0.7) !important;
  }
}

/* Card Number Badge */
.steps-grid article > span {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font: 800 35px/1 'Barlow Condensed', Impact, sans-serif !important;
  box-shadow: 3px 3px 0 var(--ink);
  transform: scale(0.95);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease, rotate 0.5s ease;
}

.steps-grid article.step-reached > span {
  background: var(--cyan, #caf34c) !important;
  transform: scale(1);
  rotate: -7deg;
}

/* Card Heading and Paragraph typography */
.steps-grid h3 {
  font-family: 'Barlow Condensed', Impact, sans-serif !important;
  font-weight: 800 !important;
  font-size: 24px !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
  letter-spacing: -0.3px !important;
  color: var(--ink) !important;
  margin: 24px 0 12px !important;
  opacity: 1 !important;
  transform: none !important;
}

.steps-grid p {
  font-family: 'Plus Jakarta Sans', Manrope, Arial, sans-serif !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  color: var(--muted, #596153) !important;
  margin: 0 !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Cursor-following lime light reflection */
.card-spotlight {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(circle 140px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(202, 243, 76, 0.35) 0%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.steps-grid article:hover .card-spotlight {
  opacity: 1;
}

/* Desktop Hover & Pointer Interaction */
@media (hover: hover) and (pointer: fine) {
  .steps-grid article {
    cursor: default;
  }
  .steps-grid article:hover {
    background: #ffffff !important;
    box-shadow: 10px 14px 0 var(--ink) !important;
  }
  .steps-grid article:hover > span {
    transform: scale(1.1);
    rotate: 7deg;
    box-shadow: 4px 4px 0 var(--ink);
  }
}

/* ================= Mobile & Tablet Responsive Timeline ================= */
@media (max-width: 900px) {
  .steps,
  #methodology.steps {
    padding: 70px 6% 85px !important;
  }

  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 0 0 0 36px !important;
    margin-top: 35px !important;
  }
  
  /* Vertical timeline track on left margin */
  .steps-grid::before {
    left: 10px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 6px;
    height: 100%;
    transform-origin: top;
  }
  
  .steps-grid::after {
    left: 10px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 6px;
    height: 100%;
    transform-origin: top;
    transform: scaleY(var(--route-progress, 0));
  }
  
  .steps-timeline-head {
    left: 13px;
    top: calc(var(--route-progress, 0) * 100%);
    transform: translate(-50%, -50%) scale(calc(var(--route-progress, 0) > 0.01 ? 1 : 0));
    transition: top 0.12s linear;
  }
  
  .steps-grid article {
    padding: 24px 20px !important;
  }
}

/* ================= Accessibility & Reduced Motion ================= */
@media (prefers-reduced-motion: reduce) {
  .steps-orb,
  .steps-node-spotlight,
  .steps-timeline-head {
    display: none !important;
  }
  
  .steps-grid article {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  
  .steps-word,
  .steps .label::after,
  .steps h2 em::after,
  .steps-grid h3,
  .steps-grid p {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  .steps-grid::after {
    transform: scaleX(1) !important;
  }
}
