/* PrimePaire animations: pure CSS keyframes, triggered by classes jQuery toggles. */

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Without JS, never hide content. */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Floating gradient blobs ---------- */

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -40px) scale(1.06); }
  66%  { transform: translate(-25px, 20px) scale(.96); }
  100% { transform: translate(0, 0) scale(1); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  pointer-events: none;
  animation: float 18s ease-in-out infinite;
  z-index: 0;
}

.blob-brand { background: var(--gradient); }
.blob-brass { background: var(--gradient-match); opacity: .3; animation-duration: 22s; animation-delay: -6s; }
.blob-soft  { background: var(--brand-soft); opacity: .4; animation-duration: 26s; animation-delay: -12s; }

/* ---------- Swipe-card stack (hero) ----------
   Four cards rotate through front → fly off → hidden behind the stack →
   third → second → front. Each card runs the same 12s cycle, offset by 3s,
   so one card leaves every 3s (same rhythm as before, with one more profile).
   Phases (fraction of 12s): front 0–18%, fly off 18–23.25%, hidden 24–43.75%,
   fade in as third 43.75–50%, third until 68.75%, second 75–93.75%, front 100%. */

@keyframes swipeRight {
  0%      { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
  18%     { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
  23.25%  { transform: translate(150%, -6%) rotate(24deg) scale(1); opacity: 0; z-index: 3; }
  24%     { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 0; z-index: 0; }
  43.75%  { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 0; z-index: 0; }
  50%     { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 1; z-index: 1; }
  68.75%  { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 1; z-index: 1; }
  75%     { transform: translate(0, 12px) rotate(0) scale(.95); opacity: 1; z-index: 2; }
  93.75%  { transform: translate(0, 12px) rotate(0) scale(.95); opacity: 1; z-index: 2; }
  100%    { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
}

@keyframes swipeLeft {
  0%      { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
  18%     { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
  23.25%  { transform: translate(-150%, -6%) rotate(-24deg) scale(1); opacity: 0; z-index: 3; }
  24%     { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 0; z-index: 0; }
  43.75%  { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 0; z-index: 0; }
  50%     { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 1; z-index: 1; }
  68.75%  { transform: translate(0, 24px) rotate(0) scale(.9); opacity: 1; z-index: 1; }
  75%     { transform: translate(0, 12px) rotate(0) scale(.95); opacity: 1; z-index: 2; }
  93.75%  { transform: translate(0, 12px) rotate(0) scale(.95); opacity: 1; z-index: 2; }
  100%    { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; z-index: 3; }
}

/* LIKE / NOPE stamps fade in just before the card leaves. */
@keyframes stampIn {
  0%, 9%     { opacity: 0; transform: scale(1.4) rotate(var(--stamp-rot, -14deg)); }
  15%        { opacity: 1; transform: scale(1) rotate(var(--stamp-rot, -14deg)); }
  23.25%     { opacity: 1; transform: scale(1) rotate(var(--stamp-rot, -14deg)); }
  24%, 100%  { opacity: 0; transform: scale(1.4) rotate(var(--stamp-rot, -14deg)); }
}

.swipe-card { animation: swipeRight 12s cubic-bezier(.5, 0, .3, 1) infinite; }
.swipe-card.go-left { animation-name: swipeLeft; }
.swipe-card:nth-child(1) { animation-delay: 0s; }
.swipe-card:nth-child(2) { animation-delay: -9s; }
.swipe-card:nth-child(3) { animation-delay: -6s; }
.swipe-card:nth-child(4) { animation-delay: -3s; }

.swipe-card .stamp { animation: stampIn 12s ease infinite; }
.swipe-card:nth-child(1) .stamp { animation-delay: 0s; }
.swipe-card:nth-child(2) .stamp { animation-delay: -9s; }
.swipe-card:nth-child(3) .stamp { animation-delay: -6s; }
.swipe-card:nth-child(4) .stamp { animation-delay: -3s; }

/* ---------- Heart pulse ---------- */

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.14); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.1); }
  48%      { transform: scale(1); }
}

.pulse { animation: pulse 2.4s ease-in-out infinite; display: inline-block; }
.navbar-brand:hover .brand-mark,
.site-footer a:hover .brand-mark { animation: pulse 1.2s ease-in-out infinite; }

/* ---------- Best-value glow ---------- */

@keyframes glow {
  0%, 100% { box-shadow: 0 8px 16px rgba(0, 0, 0, .15), 0 0 0 0 rgba(184, 134, 43, .0); }
  50%      { box-shadow: 0 8px 16px rgba(0, 0, 0, .15), 0 0 28px 4px rgba(184, 134, 43, .38); }
}

.glow { animation: glow 3.2s ease-in-out infinite; }

/* ---------- Hover lift ---------- */

.btn {
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0); box-shadow: none; }

.lift { transition: transform .25s ease, box-shadow .25s ease; }
.lift:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lift); }

/* ---------- Back to top ---------- */

.back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}

.back-to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ---------- Navbar ---------- */

.site-nav { transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease; }

/* ---------- Reduced motion: switch everything off ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .btn:hover, .lift:hover { transform: none; }
  .swipe-card .stamp { opacity: 0; }
}
