/* --- Visual section separation --- */
.section-wrapper { padding: 64px 20px; }
.info-section {
  border-top: 1px solid rgba(255,255,255,0.05);
}
.info-section:last-of-type {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.section-wrapper.alt-bg {
  background: rgba(27, 30, 37, 0.5);
  border-top: 1px solid rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  /* Объединяем все transition в одном объявлении для соответствия спецификации */
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays - эти задержки применяются только к анимации при загрузке страницы */
.fade-in.delay-1 { transition-delay: 0.1s; }
.fade-in.delay-2 { transition-delay: 0.2s; }
.fade-in.delay-3 { transition-delay: 0.3s; }

/* Enhanced card hover animations - обеспечение соответствия спецификации */
.card {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Enhanced button hover effects */
.btn {
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Navigation link hover effect */
nav a {
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateX(-50%);
}
nav a:hover::after {
  width: 80%;
}

/* --- Desktop Timeline Styles for Roadmap --- */
@media (min-width: 981px) {
  .roadmap-track {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 40px;
    padding-top: 50px; /* Space for the icons and line */
    gap: 0; /* Remove grid gap for flex layout */
  }

  /* The main timeline bar */
  .roadmap-track::before {
    content: '';
    position: absolute;
    top: 25px; /* Vertically center on the icons */
    left: 12.5%; /* Start from center of first item */
    width: 75%; /* End at center of last item (100% - 12.5% - 12.5%) */
    height: 2px;
    background-color: rgba(124, 92, 255, 0.2);
    z-index: 0;
  }

  .roadmap-item {
    width: 25%; /* Each item takes a quarter of the space */
    padding: 20px;
    text-align: center;
    background: transparent;
    border: none;
    display: flex; flex-direction: column; align-items: center;
  }

  .roadmap-icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1; /* Icon above the line */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--bg);
    border: 2px solid rgba(124, 92, 255, 0.3);
    border-radius: 50%;
    margin: 0;
    transition: border-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  
  .roadmap-item:hover .roadmap-icon {
    border-color: var(--accent);
    transform: translateX(-50%) scale(1.1);
  }

  .roadmap-status {
    margin-top: 60px; /* Push it down below the icon */
  }

  .roadmap-item h4 {
    margin-top: 0; /* Reset margin-top, as status now handles it */
  }
}

/* --- Infinite Canvas Background --- */
@keyframes scroll-bg-near {
  from { transform: translateY(0px); }
  to { transform: translateY(-400px); } /* Faster layer */
}
@keyframes scroll-bg-far {
  from { transform: translateY(0px); }
  to { transform: translateY(-200px); } /* Slower layer */
}
.infinite-canvas-bg-near, .infinite-canvas-bg-far {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 150%; /* Taller than viewport to allow for scrolling */
  /* JS fallback will set transform if animation-timeline is not supported */
}
.infinite-canvas-bg-far { z-index: 0; }
.infinite-canvas-bg-near { z-index: 1; }

/* Apply CSS animation only if supported (Chrome/Edge) */
@supports (animation-timeline: scroll(root)) {
  .infinite-canvas-bg-near {
    animation: scroll-bg-near linear;
    animation-timeline: scroll(root);
  }
  .infinite-canvas-bg-far {
    animation: scroll-bg-far linear;
    animation-timeline: scroll(root);
  }
}

.canvas-item {
  position: absolute;
  border-radius: 8px;
}

/* Near items (faster, more opaque) */
.infinite-canvas-bg-near .canvas-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  opacity: 0.6;
}
.item-1 { top: 15%; left: 15%; width: 200px; height: 150px; }
.item-2 { top: 55%; left: 75%; width: 180px; height: 220px; transform: rotate(5deg); }
.item-3 { top: 85%; left: 10%; width: 120px; height: 180px; transform: rotate(-8deg); }

/* Far items (slower, smaller, more transparent) */
.infinite-canvas-bg-far .canvas-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  opacity: 0.4;
}
.item-far-1 { top: 5%; left: 60%; width: 150px; height: 100px; transform: rotate(10deg); }
.item-far-2 { top: 40%; left: 5%; width: 130px; height: 170px; transform: rotate(-3deg); }
.item-far-3 { top: 70%; left: 50%; width: 190px; height: 130px; }

/* Header scrolled animation */
header.scrolled {
  background-color: rgba(15, 23, 32, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 10px 0;
}

/* Enhanced button primary styling */
.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(106, 90, 205, 0.6);
  transform: translateY(-3px);
}

/* Fix for sticky header overlapping content on anchor link navigation */
section[id] {
  scroll-margin-top: 100px; /* Match initial header height */
}