/* Reset & base */

:root {
  --perspective: 1800px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --carousel-height: 500px;
}

.stage {
  position: relative;
  width: 100vw;
  height: var(--carousel-height);
  overflow: hidden;
  perspective: var(--perspective);
  /* Must chain the wheel out to the page: the cards overflow this box, which
     makes it a scroll container, and `overscroll-behavior: none` would trap
     wheel events here instead of letting them drive the pinned scroll. */
  overscroll-behavior: auto;
  -webkit-user-select: none;
  user-select: none;
  /* Full-bleed and centred in the viewport regardless of parent padding */
  margin: 50px calc(50% - 50vw);
}

.loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: #ffffff;
  transition:
    opacity 0.2s var(--ease),
    visibility 0.2s linear;
}

.loader--hide {
  opacity: 0;
  visibility: hidden;
}

.loader__content {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 220px;
}

.loader__ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #ddd;
  border-top-color: #333;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#bg {
  display: none;
}

.stage.carousel-mode {
  /* Scroll-driven: the page keeps its normal touch/scroll behaviour */
  touch-action: pan-y;
}

.cards {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  transform-style: preserve-3d;
}

.as_card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(26vw, 360px);
  aspect-ratio: 6/7;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, filter;
  transform-origin: 90% center;
  contain: layout paint;
}

.card__img {
  border-radius: 15px;
  opacity: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 1199px) {
  .as_card {
    width: min(50vw, 360px);
  }
}

@media (max-width: 991px) {
  .as_card {
    width: min(60vw, 360px);
  }
}

@media (max-width: 767px) {
  .as_card {
    width: min(70vw, 360px);
    aspect-ratio: 2 / 3;
  }
}

/* ============================================================================
   TIMELINE STYLES
   ============================================================================ */

/* Scroll Container */
.timeline-container {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: hidden;
  white-space: nowrap;
  z-index: 2;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* Hide scrollbar completely */
.timeline-container::-webkit-scrollbar {
  display: none;
}

.timeline-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timeline-track {
  position: relative;
  display: inline-block;
  min-width: 5800px;
  height: 100%;
}

/* SVG Canvas & Path Styles */
.line-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.line-canvas path {
  fill: none;
  stroke: #ff0000;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0px 0px 8px rgba(255, 0, 0, 0.95))
    drop-shadow(0px 0px 4px rgba(255, 0, 0, 0.6));
  transition: stroke-dashoffset 0.1s linear;
}

/* Timeline Nodes */
.timeline-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.star-icon {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  filter: drop-shadow(0px 0px 12px rgba(255, 255, 255, 1))
    drop-shadow(0px 0px 6px rgba(255, 0, 0, 0.5));
  cursor: pointer;
  transition: all 0.3s ease;
}

/* .star-icon:hover {
  transform: scale(1.4);
  fill: #ff0000;
  filter: drop-shadow(0px 0px 16px rgba(255, 0, 0, 1))
    drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.8));
} */

.node-content {
  position: absolute;
  width: 240px;
  white-space: normal;
  pointer-events: auto;
  padding: 15px;
  background: rgba(5, 4, 10, 0.85);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  margin: 10px 0;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.3s;
}

.node_circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: auto;
  aspect-ratio: 1 / 1;
  background-color: rgba(237, 28, 36, 0.1);
  box-shadow: 0 0 10px 10px rgba(237, 28, 36, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: -2;
  transition: all 0.25s ease;
}

.timeline-node:hover .node_circle {
  transform: translate(-50%, -50%) scale(1);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.node-content.pos-below {
  top: 35px;
  left: 0;
}

.node-content.pos-above {
  bottom: 35px;
  left: 0;
}

.year {
  font-size: 2.2rem;
  font-weight: 300;
  color: #ff0000;
  line-height: 1;
  margin-bottom: 10px;
}

.description {
  font-size: 1rem;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}
