@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=Poppins:wght@300;400;500;600&display=swap');

body,
html {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #121212;
  color: white;
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6,
.year-content h1, .year-content h2, .year-content h3 {
  font-family: 'Crimson Text', serif;
}


/* Pinned Timeline Section */
.pinned-section {
  position: relative;
}

/* Sticky container to pin during scroll */
.timeline-container {
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: #121212;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 20px;
}

/* Main content container */
.content-wrapper {
  position: relative;
  height: 80vh;
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Each year's content */
.year-content {
  position: absolute;
  opacity: 0;
  transition: opacity 0.8s ease;
  max-width: 100%;
}

.year-content.active {
  opacity: 1;
  animation: fadeInUp 0.8s ease;
}

/* Timeline bar at bottom */
.timeline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  position: absolute;
  bottom: 5%;
  padding: 10px;
  text-align: center;
}

.timeline .year {
  font-size: 14px;
  opacity: 0.4;
  transition: opacity 0.3s, font-weight 0.3s;
  cursor: default;
}

.timeline .year.active {
  opacity: 1;
  font-weight: bold;
  border-bottom: 2px solid white;
}

/* Scroll trigger spacers for IntersectionObserver */
.scroll-triggers .trigger {
  height: 100vh;
  width: 100%;
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive Adjustments ===== */

/* Small Tablets & Phones */
@media (max-width: 768px) {
  .timeline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    bottom: 3%;
    padding: 5px 10px;
  }

  .timeline .year {
    font-size: 13px;
  }

  .content-wrapper {
    height: 70vh;
  }
}

/* Phones (portrait) */
@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .timeline-container {
    padding: 10px;
  }

  .timeline .year {
    font-size: 12px;
    min-width: 60px;
  }

  .content-wrapper {
    height: auto;
    padding-bottom: 40px;
  }

  .year-content {
    padding: 0 10px;
  }
}
