/* ── Projects carousel ── */
.carousel {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* counter */
.carousel__counter {
  position: fixed;
  top: calc(var(--nav-h) + 16px);
  left: 16px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  z-index: 10;
}

/* track holds all slides stacked */
.carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* individual slide */
.carousel__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel__slide.is-active {
  opacity: 1;
  pointer-events: all;
}

/* full-screen background */
.carousel__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45);
  transform: scale(1.05);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel__slide.is-active .carousel__bg {
  transform: scale(1);
}

/* glass card */
.carousel__card {
  position: relative;
  z-index: 2;
  width: clamp(260px, 30vw, 420px);
  aspect-ratio: 3/4;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  text-decoration: none;
}

a.carousel__card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-4px) !important;
}

.carousel__slide.is-active .carousel__card {
  transform: translateY(0);
}

.carousel__card-img {
  flex: 1;
  background-size: cover;
  background-position: center;
  opacity: 0.85;
}

.carousel__tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  padding: 14px 18px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.2);
}

/* project title */
.carousel__title {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  font-family: var(--font-ui);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.carousel__slide.is-active .carousel__title {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* arrows */
.carousel__arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 3rem;
  line-height: 1;
  padding: 16px 20px;
  z-index: 10;
  transition: color var(--transition), transform 0.2s ease;
}

.carousel__arrow:hover { color: #ffffff; }

.carousel__arrow--prev {
  left: 20px;
  cursor: none;
}
.carousel__arrow--next {
  right: 20px;
  cursor: none;
}

.carousel__arrow--prev:hover { transform: translateY(-50%) translateX(-4px); }
.carousel__arrow--next:hover { transform: translateY(-50%) translateX(4px); }

/* Mobile */
@media (max-width: 768px) {
  .carousel__card {
    width: clamp(200px, 60vw, 300px);
  }

  .carousel__title {
    font-size: clamp(1.4rem, 6vw, 2rem);
    bottom: 80px;
    white-space: normal;
    text-align: center;
    width: 90%;
  }

  .carousel__arrow { font-size: 2rem; padding: 12px 14px; }
  .carousel__arrow--prev { left: 8px; }
  .carousel__arrow--next { right: 8px; }
}
