/* Timeline Section styling */
#vertical-section-trigger {
  padding: 120px 5% 40px 5%;
  min-height: 180vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: var(--bg-surface-secondary);
  position: relative;
  overflow: hidden;
}

.vertical-stack-container {
  width: 100%;
  max-width: 1200px;
  position: relative;
  margin-top: 60px;
  margin-inline: auto;
}

.vertical-timeline-line {
  position: absolute;
  left: 30px;
  top: -240px;
  bottom: 0;
  width: 1.5px;
  background: rgba(30, 70, 74, 0.05);
}

.vertical-timeline-progress {
  position: absolute;
  left: 30px;
  top: 0;
  width: 2px;
  height: 0%;
  background: linear-gradient(180deg, #26b8cd, #ffee00) !important;
  box-shadow: 
    0 0 10px rgba(38, 184, 205, 0.85),
    0 0 20px rgba(255, 238, 0, 0.4);
  z-index: 2 !important;
}

/* Glowing tip particle at the bottom tip of the scroll progress line */
.vertical-timeline-progress::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #ffee00;
  border: 2.5px solid #0c0702;
  border-radius: 50% !important;
  box-shadow: 
    0 0 0 1.5px #26b8cd,
    0 0 12px rgba(255, 238, 0, 0.85),
    0 4px 8px rgba(12, 7, 2, 0.15);
  z-index: 5;
}

.vertical-stack {
  display: flex;
  flex-direction: column;
  padding-bottom: 0px;
  gap: 20px;
  position: relative;
  z-index: 3;
}

.vertical-slide {
  position: relative;
  height: 95vh;
  width: 100%;
}

.vertical-slide:last-child {
  height: auto;
  min-height: max-content;
  padding-bottom: 80px;
}

.vertical-slide:last-child .sticky-wrapper {
  position: relative;
  top: 0;
  opacity: 1;
  transform: translateY(0);
}

.sticky-wrapper {
  position: sticky;
  top: 15vh;
  display: flex;
  gap: 32px;
  width: 100%;
  opacity: 0.2;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

.vertical-slide.active .sticky-wrapper {
  opacity: 1;
  transform: translateY(0);
}

.slide-marker {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50% !important;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  color: var(--text-light);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  margin-top: 40px; /* Aligns the marker center with the headline text line (ignoring the fraction text) */
}

.vertical-slide.active .slide-marker {
  background: #1F1C1C;
  border-color: #1F1C1C;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(62, 163, 220, 0.25);
}

.slide-marker span {
  font-size: 1.5rem;
}

/* Spacious stacked card layout inside slide body */
.slide-body {
  flex: 1;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0px;
  padding: 35px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  text-align: left;
  overflow: visible !important; /* Allow the triangle pointer to display outside card */
  transition: var(--transition-smooth);
  position: relative;
}

/* Triangle Pointer pointing from Card to Circle (Patterned CAD detail) */
.slide-body::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 64px; /* Vertically centered with the marker and title first line */
  width: 14px;
  height: 14px;
  background-color: #ffffff;
  transform: rotate(45deg);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 5;
  transition: var(--transition-smooth);
}

.vertical-slide.active .slide-body {
  border-color: rgba(62, 163, 220, 0.25);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.vertical-slide.active .slide-body::before {
  border-bottom-color: rgba(62, 163, 220, 0.25);
  border-left-color: rgba(62, 163, 220, 0.25);
}

.slide-body .slide-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: block;
}

.slide-body .phase-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.slide-body h3 {
  font-family: var(--font-headings);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-color);
  line-height: 1.3;
}

.slide-body p.pain-point {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

.slide-content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: center;
}

.slide-text-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}



.isometric-svg-asset {
  width: 100%;
  max-width: 200px;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(30, 70, 74, 0.08));
  animation: float-isometric 6s ease-in-out infinite;
}

@keyframes float-isometric {
  0% { transform: translateY(0px) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(-1deg); }
}

.isometric-mini-asset-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 220px;
  height: 180px;
}

.isometric-mini-asset {
  width: 100%;
  max-width: 200px;
  max-height: 160px;
  filter: drop-shadow(0 10px 20px rgba(30, 70, 74, 0.06));
  animation: float-isometric-mini 7s ease-in-out infinite;
}

@keyframes float-isometric-mini {
  0% { transform: translateY(0px) rotate(0.5deg); }
  50% { transform: translateY(-5px) rotate(-0.5deg); }
  100% { transform: translateY(0px) rotate(0.5deg); }
}

/* Horizontal Features Scroll layout spanning full width */
.slide-solution-area {
  margin: 35px -36px -36px -36px;
  padding: 35px;
  background-color: var(--color-accent-soft);
  border-radius: 0px;
  border-top: 1px solid rgba(0, 155, 151, 0.15);
  position: relative;
  overflow: visible;
}

.slide-solution-area::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 60px;
  width: 16px;
  height: 16px;
  background-color: var(--color-accent-soft);
  transform: rotate(45deg);
  border-top: 1px solid rgba(0, 155, 151, 0.15);
  border-left: 1px solid rgba(0, 155, 151, 0.15);
  z-index: 1;
}

.slide-solution-header {
  margin-bottom: 24px;
}

.slide-solution-title {
  font-family: var(--font-headings);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 800;
  color: var(--text-color);
  margin: 8px 0 0 0;
  line-height: 1.2;
}

.features-wrapper {
  position: relative;
  overflow: visible;
}

.features-scroll {
  display: flex;
  gap: 24px;
  padding-bottom: 12px;
  width: max-content;
  will-change: transform;
}

@media (min-width: 1024px) {
  .features-scroll {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    transform: none !important;
  }
}

.feature-card {
  flex: 0 0 300px;
  min-height: auto;
  background: none !important;
  border: none !important;
  padding: 0;
  border-radius: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.3s;
}

@media (min-width: 1024px) {
  .feature-card {
    flex: 1 !important;
  }
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-card h5 {
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Sticky Dot Navigation - Minimal Capsule Pill Container */
.timeline-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 5px;
  border-radius: 9999px !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.timeline-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hide timeline sticky nav on mobile */
@media (max-width: 968px) {
  .timeline-nav {
    display: none !important;
  }
}

.timeline-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.timeline-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50% !important;
  background: var(--text-light);
  opacity: 0.4;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3EA3DC;
  opacity: 0;
  transform: translateX(-15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  pointer-events: none;
  position: absolute;
  left: 36px;
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 9999px !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* Hover States */
.timeline-nav-item:hover .timeline-nav-dot {
  opacity: 1;
  transform: scale(1.6);
  background: var(--color-accent-light);
}

.timeline-nav-item:hover .timeline-nav-label {
  opacity: 1;
  transform: translateX(0);
}

/* Active Dot */
.timeline-nav-item.active .timeline-nav-dot {
  opacity: 1;
  transform: scale(1.6);
  background: #3EA3DC;
  box-shadow: 0 0 0 4px rgba(62, 163, 220, 0.2);
}

/* Timeline slide template text classes */
.slide-body .slide-num-fraction {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
  display: block;
}

.slide-body .slide-title {
  font-family: var(--font-headings);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.slide-body .slide-sub-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-color);
  margin: 0 0 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Icon Badges */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50% !important;
  flex-shrink: 0;
}

.icon-badge span {
  font-size: 14px !important;
  color: #ffffff !important;
  font-variation-settings: 'FILL' 1, 'wght' 600 !important;
}

.problem-badge-icon {
  background-color: #c2410c; /* Orange/Brown Badge */
}

.solution-badge-icon {
  background-color: #009B97; /* Teal accent */
}

.slide-body p.pain-point {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 900px;
}

.slide-body .slide-solution-title {
  font-family: var(--font-headings);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 800;
  color: var(--text-color);
  margin: 0;
  line-height: 1.2;
}

.slide-visual-col {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 220px;
  height: 180px;
  transform: translateY(12px); /* Straddles the boundary between top white and bottom mint background */
  z-index: 10;
}

/* Responsive Timeline Queries */
@media (max-width: 968px) {
  #vertical-section-trigger {
    padding-top: 60px;
    padding-left: 4%;
    padding-right: 4%;
  }

  .vertical-timeline-line,
  .vertical-timeline-progress {
    left: 20px;
  }

  .vertical-timeline-line {
    top: 0 !important;
  }

  .vertical-stack-container {
    margin-top: 30px;
  }

  .sticky-wrapper {
    gap: 16px;
    top: 12vh;
  }

  .slide-marker {
    width: 40px;
    height: 40px;
    margin-top: 28px;
    flex-shrink: 0;
  }

  .slide-marker span {
    font-size: 1.1rem;
  }

  .slide-body {
    padding: 20px 18px;
    border-radius: 0px;
  }

  .slide-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .slide-body .slide-solution-title {
    font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  }

  .slide-body .pain-point,
  .slide-body p.pain-point {
    font-size: 13.5px;
  }

  .slide-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .slide-solution-col {
    border-left: none;
    padding-left: 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary);
  }

  .slide-content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .slide-visual-col {
    display: none;
  }

  .isometric-svg-asset {
    max-width: 140px;
  }

  .slide-solution-area {
    margin: 20px -18px -20px -18px;
    padding: 20px 0;
    border-radius: 0px;
  }

  .slide-solution-header {
    padding: 0 18px;
    margin-bottom: 18px;
  }

  .slide-body::before {
    top: 48px;
  }
}

/* On small phones: abandon the sticky-scroll UX entirely.
   Replace with a simple stacked card layout to eliminate the
   enormous vh-based gaps between timeline items. */
@media (max-width: 768px) {
  #vertical-section-trigger {
    padding-top: 48px;
    min-height: unset;
  }

  /* Hide the animated progress line/particle — doesn't work without sticky scroll */
  .vertical-timeline-progress,
  .timeline-wires-svg {
    display: none;
  }

  /* Remove the viewport-height slot that creates empty space */
  .vertical-slide {
    height: auto !important;
    min-height: unset !important;
  }

  /* Remove sticky positioning — just let cards flow naturally */
  .sticky-wrapper {
    position: relative !important;
    top: auto !important;
    opacity: 1 !important;
    transform: none !important;
    gap: 0;
  }

  /* All slides always visible — no fade-in-on-scroll */
  .vertical-slide .sticky-wrapper {
    opacity: 1;
    transform: none;
  }

  /* Tighten the stack gap */
  .vertical-stack {
    gap: 12px;
  }

  /* Hide the left marker circle to save horizontal space */
  .slide-marker {
    width: 36px;
    height: 36px;
    margin-top: 18px;
    border: 1px solid rgba(30, 70, 74, 0.15);
    display: none;
  }

  /* Card fills entire width without the marker */
  .sticky-wrapper {
    gap: 0 !important;
  }

  /* Triangle pointer not needed when no marker */
  .slide-body::before {
    display: none;
  }

  .slide-body {
    padding: 20px 16px;
    overflow: hidden !important; /* Contain children so they don't overflow viewport */
  }

  /* Let long headlines wrap naturally */
  .slide-body .slide-title {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .slide-body h3 {
    font-size: 1.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .slide-body .slide-solution-title {
    font-size: 1.05rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Sub-labels should also wrap */
  .slide-body .slide-sub-label {
    font-size: 10px;
  }

  /* ---- Features Scroll inside timeline cards ---- */
  .slide-solution-area {
    margin: 16px -16px -20px -16px;
    padding: 20px 0 16px 0;
    border-radius: 0px;
  }

  .slide-solution-header {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  /* Make features wrapper static and aligned */
  .features-wrapper {
    margin: 0;
    padding: 0 16px;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  /* Hide the decorative pointer arrow on mobile */
  .slide-solution-area::before,
  .features-wrapper::before {
    display: none;
  }

  /* Make the features container scrollable and ignore JS vertical scroll transforms */
  .features-scroll {
    display: flex !important;
    gap: 14px;
    width: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory !important;
    padding-bottom: 4px;
    padding-right: 16px;
    transform: none !important; /* Override JS scroll translations on mobile */
  }

  .feature-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }

  .feature-card h5 {
    font-size: 13.5px;
  }

  .feature-card p {
    font-size: 12.5px;
  }

  /* Last slide also needs no extra padding-bottom */
  .vertical-slide:last-child {
    padding-bottom: 24px;
  }

  /* Ripple animation too heavy for non-sticky context */
  .vertical-slide.active .slide-marker::before {
    display: none;
  }

  /* Vertical timeline line not needed when markers are hidden */
  .vertical-timeline-line {
    display: none;
  }
}


/* Custom left-shifted timeline header matching Figma/moodboard style */
#vertical-section-trigger .section-header {
  text-align: left;
  margin-inline: 0;
  margin-left: 93px;
  max-width: 800px;
  margin-bottom: 80px;
}

.timeline-wires-svg {
  position: absolute;
  left: 0;
  top: -240px;
  width: 150px;
  height: calc(100% + 240px);
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 968px) {
  #vertical-section-trigger .section-header {
    text-align: center;
    margin-inline: auto;
    margin-left: 0;
    margin-bottom: 30px;
    padding: 0 8px;
  }
  .timeline-wires-svg {
    left: -10px !important;
    opacity: 0.5;
  }
}

/* Mild ripple effect when slide marker is active (touches progress particle) */
.vertical-slide.active .slide-marker::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 0px;
  border: 2px solid var(--color-accent);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  animation: marker-ripple 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes marker-ripple {
  0% {
    transform: scale(0.98);
    opacity: 0.8;
  }
  55% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}
