/* ===== Portrait rails & cards ===== */

/* Full-screen overlay where cards live */
.portrait-rail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1; /* above bg, below glass panel */
}

.rail-left,
.rail-right {
  position: absolute;
  inset: 0;
}

/* Base card */
.portrait-card {
  position: absolute;
  width: 140px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(5, 5, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
  opacity: 0;

  transform-origin: center center;
  transform: rotate(-40deg);

  animation: comet-fall var(--duration, 12s) linear infinite;
}

/* Image */
.portrait-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  filter: saturate(0.95) contrast(1.06) brightness(1.04);
}

.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;                  /* was: -12px */
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;          /* helps clip inside */
}

/* Motion for cards */
@keyframes comet-fall {
  0% {
    transform: translate(0, 0) rotate(-40deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(70vw, 160vh) rotate(-40deg);
    opacity: 0;
  }
}

/* Hide on mobile so it doesn’t get too busy */
@media (max-width: 900px) {
  .portrait-rail {
    display: none;
  }
}
