#timeline-module {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  z-index: 1000;
  perspective: 1200px;
}

.carousel-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-track {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.timeline-card {
  position: absolute;
  width: 70vw;
  height: 70vh;
  transition: transform 0.8s cubic-bezier(0.17, 0.67, 0.24, 0.99),
    opacity 0.6s ease-out;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center center;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.card-inner {
  text-align: center;
  color: white;
  padding: 20px;
}

.card-center {
  transform: translateZ(0) scale(1);
  opacity: 1;
  z-index: 10;
  filter: none;
}

.card-secondary {
  transform: translateZ(-400px) scale(0.85);
  opacity: 0.4;
  filter: blur(8px);
}

.card-hidden {
  opacity: 0;
  pointer-events: none;
}

.exit-overlay {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50vh;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.exit-overlay.bottom {
  top: auto;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.exit-overlay.active {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .carousel-track {
    transform: none !important;
  }
  .timeline-card {
    position: relative;
    width: 90vw;
    height: auto;
    margin-bottom: 20px;
    transform: none !important;
    left: auto;
    top: auto;
  }
  #timeline-module {
    position: relative;
    height: auto;
    display: block;
    perspective: none;
  }
  .exit-overlay {
    display: none;
  }
}