/* ============================================
   Animation States
   ============================================ */

/* Initial hidden state for animated elements */
[data-animate] {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate="fade-up"] {
  transform: translateY(30px);
}

[data-animate="fade-in"] {
  transform: none;
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate="fade-right"] {
  transform: translateX(-30px);
}

/* Visible state after IntersectionObserver triggers */
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

/* ============================================
   Hero Word-by-Word Animation
   ============================================ */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  transition-delay: calc(var(--i) * 250ms);
}

.hero-animate .hero-word {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Navbar Scroll State
   ============================================ */
.navbar-scrolled {
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 41, 55, 0.5);
}

/* Active nav link */
.nav-link.active {
  color: #6366F1;
}

/* ============================================
   Mobile Menu Hamburger Animation
   ============================================ */
.menu-open #bar1 {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-open #bar2 {
  opacity: 0;
}

.menu-open #bar3 {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Timeline Responsive
   ============================================ */
@media (min-width: 768px) {
  .timeline-entry:nth-child(odd) {
    margin-left: auto;
    margin-right: 0;
    padding-right: 3rem;
    padding-left: 0;
    text-align: right;
  }

  .timeline-entry:nth-child(odd) .timeline-dot {
    left: auto;
    right: -9px;
  }

  .timeline-entry:nth-child(odd) .flex-wrap {
    justify-content: flex-end;
  }

  .timeline-entry:nth-child(even) {
    margin-right: auto;
    margin-left: 0;
    padding-left: 3rem;
    padding-right: 0;
  }

  .timeline-entry:nth-child(even) .timeline-dot {
    right: auto;
    left: -9px;
  }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0B0F19;
}

::-webkit-scrollbar-thumb {
  background: #1F2937;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* ============================================
   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;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   Selection
   ============================================ */
::selection {
  background-color: rgba(99, 102, 241, 0.3);
  color: white;
}
