/* ==========================================================================
   projects-motion.css: scroll-linked animations for the Projects page
   Cards animate as they scroll into view. Chrome and Edge support this;
   in other browsers the cards simply appear without the entrance motion.
   ========================================================================== */

/* ---------- Keyframes ---------- */
@keyframes pjCardIn {
  from {
    opacity: 0;
    transform: perspective(1000px) translateY(90px) rotateX(20deg) scale(0.95);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes pjMarkIn {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@keyframes pjItemIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes pjPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pjShimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

/* ---------- Card entrance: plays as the card scrolls into view ----------
   "backwards" keeps the start state until the card is in view and then
   releases it, so the hover lift still works afterwards. */
.pj-slot > .pc-card {
  animation: pjCardIn linear backwards;
  animation-timeline: view();
  animation-range: entry 0% cover 35%;
}

/* The monogram wipes in as its card arrives */
.pj-slot > .pc-card .pc-mark {
  animation: pjMarkIn linear backwards;
  animation-timeline: view();
  animation-range: entry 10% cover 40%;
  transition:
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    letter-spacing 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.5s ease,
    -webkit-text-stroke-color 0.5s ease;
}

/* Monogram opens up its letter spacing on hover */
.pc-card:hover .pc-mark {
  letter-spacing: 0.06em;
}

/* ---------- Title underline draws across on hover ---------- */
.pc-title {
  width: fit-content;
  padding-bottom: 6px;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0% 2px;
  transition: background-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.pc-card:hover .pc-title {
  background-size: 100% 2px;
}

/* ---------- Details cascade when a card opens ---------- */
.pc-card.is-open .pc-list li {
  animation: pjItemIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.pc-card.is-open .pc-list li:nth-child(1) { animation-delay: 0.15s; }
.pc-card.is-open .pc-list li:nth-child(2) { animation-delay: 0.25s; }
.pc-card.is-open .pc-list li:nth-child(3) { animation-delay: 0.35s; }
.pc-card.is-open .pc-list li:nth-child(4) { animation-delay: 0.45s; }

.pc-card.is-open .pc-tags li {
  animation: pjPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.pc-card.is-open .pc-tags li:nth-child(1) { animation-delay: 0.5s; }
.pc-card.is-open .pc-tags li:nth-child(2) { animation-delay: 0.58s; }
.pc-card.is-open .pc-tags li:nth-child(3) { animation-delay: 0.66s; }
.pc-card.is-open .pc-tags li:nth-child(4) { animation-delay: 0.74s; }

/* ---------- Filter tabs: lift on hover, press on click ---------- */
/* The hero file fills these tabs with "both", which would block hover lifts, so switch to "backwards" */
.pj-tabs .pj-tab {
  animation-fill-mode: backwards;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}
.pj-tabs .pj-tab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}
.pj-tabs .pj-tab:active {
  transform: translateY(0) scale(0.95);
}

/* ---------- CTA heading: shimmering lime sheen ---------- */
.pj-cta__title {
  background: linear-gradient(
    90deg,
    #dddcd7 0%,
    #dddcd7 40%,
    #c7e35c 50%,
    #dddcd7 60%,
    #dddcd7 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pjShimmer 5s linear infinite;
}

/* ---------- Reduced motion: switch the Projects animations off ---------- */
@media (prefers-reduced-motion: reduce) {
  .pj-slot > .pc-card,
  .pj-slot > .pc-card .pc-mark,
  .pc-card.is-open .pc-list li,
  .pc-card.is-open .pc-tags li,
  .pj-cta__title {
    animation: none !important;
  }
}