/* ===== PROJECTS CAROUSEL SECTION ===== */
.projects-carousel-section {
  background: #fff9f8;
  padding: 70px 0 100px;
  margin-top: 0;
  position: relative;
  z-index: 3;
  overflow: visible;
  --carousel-side-padding: max(6vw, calc((100vw - 1400px) / 2 + 40px));
}

/* Section title */
.projects-carousel-section .work-title {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 300 !important;
  color: var(--theme, #32013a);
  text-align: center;
  margin: 0 0 2.5rem 0;
  line-height: 1.25;
  padding: 0 var(--carousel-side-padding);
}

.projects-carousel-nav {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
  padding: 30px var(--carousel-side-padding) 0;
}

.projects-carousel-nav__btn {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(50, 1, 58, 0.25);
  border-radius: 4px;
  background: transparent;
  color: var(--theme, #32013a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, border-color 0.2s;
}

.projects-carousel-nav__btn:hover {
  background: rgba(50, 1, 58, 0.05);
  border-color: rgba(50, 1, 58, 0.4);
}

.projects-carousel-nav__btn:active {
  transform: scale(0.95);
}

/* ===== EMBLA CAROUSEL ===== */
.projects-carousel-clip {
  padding: 30px var(--carousel-side-padding);
  margin: -30px 0;
}

.projects-carousel {
  overflow: clip;
}

.projects-carousel__viewport {
  overflow: visible;
  padding: 30px 0;
  margin: -30px 0;
}

.projects-carousel__container {
  display: flex;
  gap: 36px;
  overflow: visible;
}

/* ~4 cards visible on desktop - fixed width cards */
.projects-carousel__slide {
  flex: 0 0 280px;
  min-width: 0;
  overflow: visible;
}

/* ===== PROJECT CARD - ELEGANT ANIMATION ===== */
.project-card {
  display: block;
  position: relative;
  aspect-ratio: 2.2 / 3.5;
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-card:hover {
  transform: scale(1.07);
}

/* Layer 1: Full color gradient - always present, becomes fully visible on hover */
.project-card__gradient-full {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* Soft organic shimmer - gentle light movement */
.project-card__wave {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background:
    radial-gradient(ellipse 80% 50% at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

.project-card:hover .project-card__wave {
  opacity: 1;
  animation: shimmerFloat 4s ease-in-out infinite;
}

/* Film grain texture */
.project-card__grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  mix-blend-mode: soft-light;
}

.project-card:hover .project-card__grain {
  opacity: 0.4;
}

@keyframes shimmerFloat {
  0%, 100% {
    background-position: 0% 0%, 100% 100%, 50% 50%;
    transform: scale(1);
  }
  33% {
    background-position: 10% 20%, 90% 80%, 40% 60%;
    transform: scale(1.02);
  }
  66% {
    background-position: -5% 10%, 105% 90%, 55% 45%;
    transform: scale(0.99);
  }
}

/* Layer 2: Image wrapper - stays in place, clips the image as it moves */
.project-card__image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  /* Wrapper doesn't move - it clips the image */
  transition: opacity 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-card:hover .project-card__image-wrapper {
  opacity: 0;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 30% 30%;
  transition: transform 0.65s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-card:hover .project-card__image {
  /* Image zooms and shifts - edges get clipped by wrapper, revealing gradient */
  transform: scale(1.35) translate(8%, 8%);
}

/* Layer 3: Top gradient blend - seamlessly blends gradient colors into image */
.project-card__top-blend {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.project-card:hover .project-card__top-blend {
  opacity: 0;
}

/* Layer 4: Content - flex layout with bottom-aligned CTA */
.project-card__content {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

/* Header: Category + Title (always visible at top) */
.project-card__header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card__category {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.75);
  font-family: "Poppins", sans-serif;
  transition: color 0.4s ease;
}

.project-card:hover .project-card__category {
  color: rgba(255, 255, 255, 0.95);
}

.project-card__title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
  font-family: "Poppins", sans-serif;
  color: white;
  max-width: 100%;
  letter-spacing: -0.01em;
  transition: color 0.4s ease;
}

/* Dark text variant for light backgrounds */
.project-card--dark-text .project-card__category {
  color: rgba(0, 0, 0, 0.6);
}

.project-card--dark-text:hover .project-card__category {
  color: rgba(0, 0, 0, 0.8);
}

.project-card--dark-text .project-card__title {
  color: rgba(0, 0, 0, 0.9);
}

.project-card--dark-text .project-card__blurb {
  color: rgba(0, 0, 0, 0.75);
}

.project-card--dark-text .project-card__cta-text {
  color: rgba(0, 0, 0, 0.7);
}

.project-card--dark-text .project-card__cta-arrow {
  color: rgba(0, 0, 0, 0.7);
}

/* Reveal section: Blurb below title, CTA at bottom (sweeps in from right on hover) */
.project-card__reveal {
  margin-top: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.08s,
    transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) 0.08s;
}

.project-card:hover .project-card__reveal {
  opacity: 1;
  transform: translateX(0);
}

.project-card__blurb {
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.01em;
}

.project-card__cta {
  margin-top: auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
}

.project-card__cta-text {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.03em;
}

.project-card__cta-arrow {
  opacity: 0.85;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-card:hover .project-card__cta-arrow {
  transform: translateX(5px);
}

/* ===== RESPONSIVE ===== */

/* Large screens - scale up cards */
@media (min-width: 1600px) {
  .projects-carousel-section {
    --carousel-side-padding: var(--content-side-padding, max(11vw, 250px));
  }

  .projects-carousel__slide {
    flex: 0 0 290px;
  }

  .projects-carousel__container {
    gap: 32px;
  }

  .project-card__title {
    font-size: 20px;
  }
}

/* 1800px+ - Use max-width container pattern like case studies */
/* With 1800px max-width and ~8vw padding each side, keep cards at ~290px + 32px gap */
/* This ensures 4+ cards visible: (290+32)*4 = 1288px fits in ~1512px available */
@media (min-width: 1800px) {
  .projects-carousel-section {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    --carousel-side-padding: calc(3vw + 5vw);
  }

  .projects-carousel__slide {
    flex: 0 0 290px;
  }

  .projects-carousel__container {
    gap: 32px;
  }
}

/* Small screens */
@media (max-width: 1400px) {
  .projects-carousel__slide {
    flex: 0 0 260px;
  }

  .project-card__title {
    font-size: 18px;
  }

  .project-card__blurb {
    font-size: 13px;
  }
}

@media (max-width: 1200px) {
  .projects-carousel__slide {
    flex: 0 0 240px;
  }

  .project-card__title {
    font-size: 17px;
  }

  .project-card__reveal {
    margin-top: 20px;
  }

  .projects-carousel__container {
    gap: 24px;
  }
}

@media (max-width: 991px) {
  .projects-carousel-section {
    --carousel-side-padding: 6vw;
  }

  .projects-carousel-section .work-title {
    font-size: 2.5rem;
  }

  .projects-carousel__slide {
    flex: 0 0 220px;
  }

  .projects-carousel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .projects-carousel-section {
    padding: 60px 0 80px;
  }

  .project-card__content {
    padding: 24px 20px;
  }

  .project-card__title {
    font-size: 17px;
  }

  .project-card__blurb {
    font-size: 13px;
    line-height: 1.6;
  }

  .project-card__reveal {
    margin-top: 18px;
  }

  .projects-carousel__container {
    gap: 16px;
  }
}

@media (max-width: 767px) {
  .projects-carousel-section .work-title {
    font-size: 2rem;
  }

  .projects-carousel__slide {
    flex: 0 0 200px;
  }

  .projects-carousel__container {
    gap: 14px;
  }

  .project-card__title {
    font-size: 16px;
  }

  .project-card__blurb {
    font-size: 12px;
  }

  .project-card__category {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .project-card__reveal {
    margin-top: 16px;
  }

  .project-card__content {
    padding: 22px 18px;
  }
}

@media (max-width: 479px) {
  .projects-carousel__slide {
    flex: 0 0 58vw;
  }

  .projects-carousel-section {
    padding: 50px 0 60px;
  }

  .projects-carousel-header {
    margin-bottom: 30px;
  }

  .project-card__content {
    padding: 20px 16px;
  }

  .project-card__title {
    font-size: 15px;
  }

  .project-card__header {
    gap: 10px;
  }

  .project-card__blurb {
    font-size: 12px;
  }

  .projects-carousel__container {
    gap: 12px;
  }
}
