.flipmode.cards {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}
.flipmode.cards .in {
  width: 100%;
  height: 100vh;
  margin: auto;
  position: relative;
}

.flipmode.cards .flip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
  transition: transform 1s ease; /* for slide */
}

.flipmode.cards .flip-inner {
  position: relative;
  width: 150px;
  height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.flipmode.cards .flip.flipped .flip-inner {
  transform: rotateY(180deg);
}

.flipmode.cards .flip-front,
.flipmode.cards .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.flipmode.cards .flip-front img,
.flipmode.cards .flip-back img {
  width: 150px;
  height: 200px;
  /* object-fit: contain; */
}

.flipmode.cards .flip-back {
  transform: rotateY(180deg);
}
/* after flip -> slide down */
.flipmode.cards .flip.slid {
  transform: translate(-50%, 400%); /* slide down */
}

.card-image-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 12px;
}

/* --- Your original gradient overlay --- */
.card-image-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
            180deg,
            rgba(68, 0, 255, 0.35) 0%,
            rgba(115, 0, 165, 0.55) 50%,
            rgba(44, 55, 84, 0.75) 100%
    );
    mix-blend-mode: overlay;
    z-index: 1;
}

/* --- Foil rainbow shimmer overlay (from the site) --- */
.card-image-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
            90deg,
            rgba(255, 0, 255, 0.3) 0%,
            rgba(0, 255, 255, 0.3) 10%,
            rgba(255, 255, 0, 0.3) 20%,
            rgba(255, 0, 255, 0.3) 30%,
            rgba(0, 0, 255, 0.3) 40%,
            rgba(255, 0, 255, 0.3) 50%
    );
    background-size: 300% 300%;
    mix-blend-mode: screen;
    opacity: 0.9;
    transition: background-position 0.05s linear;
    filter: brightness(1.3) contrast(1.2);
    z-index: 2;
}

/* --- Card image style --- */
.card-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* --- Optional hover zoom --- */
.card-image-wrapper:hover .card-img {
    transform: scale(1.03);
}

@keyframes foilMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.card-image-wrapper::after {
    animation: foilMove 6s linear infinite;
}

@media(min-width:1024px){
  .flipmode.cards .flip{
    width: 240px;
    height: 300px;
  }
  .flipmode.cards .flip-inner {
    width: 240px;
    height: 300px;
  }
  .flipmode.cards .flip-front img,
  .flipmode.cards .flip-back img {
    width: 240px;
    height: 300px;
  }

  .flipmode.cards .flip.slid {
    transform: translate(-50%, 400%);
  }
}

@media(min-width:1919px){
  .flipmode.cards .flip{
    width: 360px;
    height: 480px;
  }
  .flipmode.cards .flip-inner {
    width: 360px;
    height: 480px;
  }
  .flipmode.cards .flip-front img,
  .flipmode.cards .flip-back img {
    width: 360px;
    height: 480px;
  }
 
  .flipmode.cards .flip.slid {
    transform: translate(-50%, 400%);
  }
}

@media(min-width:2599px){
  .flipmode.cards .flip{
    width: 480px;
    height: 600px;
  }
  .flipmode.cards .flip-inner {
    width: 480px;
    height: 600px;
  }
  .flipmode.cards .flip-front img,
  .flipmode.cards .flip-back img {
    width: 480px;
    height: 600px;
  }
  .flipmode.cards .flip.slid {
    transform: translate(-50%, 800%); 
  }
}
