/* ═══════════════════════════════════════════════════
   Animations — respects prefers-reduced-motion
   ═══════════════════════════════════════════════════ */

/* ── Page entrance ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeUp .3s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .10s; }
.card:nth-child(4) { animation-delay: .15s; }
.card:nth-child(5) { animation-delay: .20s; }

/* ── Buttons: scale up on hover, compress on click ── */
.btn {
  transition: transform .15s ease, box-shadow .15s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover:not(:disabled) { transform: scale(1.04); }
.btn:active:not(:disabled) { transform: scale(0.96) !important; }

/* ── Alert slide down ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert { animation: slideDown .22s ease both; }

/* ═══════════════════════════════════════════════════
   Animated blurry blobs — 3 independent blobs
   Only transform/opacity animate (no layout/paint)
   ═══════════════════════════════════════════════════ */

/* blob1: 13s, wide energetic swing */
@keyframes blobDrift1 {
  0%   { transform: translate(0,      0)     scale(1);    }
  20%  { transform: translate(-16vw,  -4vh)  scale(1.14); }
  45%  { transform: translate( 14vw, -12vh)  scale(0.88); }
  70%  { transform: translate(  6vw,  13vh)  scale(1.18); }
  100% { transform: translate(0,      0)     scale(1);    }
}

/* blob2: 17s, diagonal deep drift */
@keyframes blobDrift2 {
  0%   { transform: translate(0,      0)     scale(1);    }
  25%  { transform: translate( 13vw, -13vh)  scale(1.14); }
  55%  { transform: translate(-12vw,  11vh)  scale(0.90); }
  80%  { transform: translate(  8vw,  -5vh)  scale(1.08); }
  100% { transform: translate(0,      0)     scale(1);    }
}

/* blob3: 10s, fast restless pulse */
@keyframes blobDrift3 {
  0%   { transform: translate(0,      0)     scale(1);    }
  30%  { transform: translate(-15vw,   8vh)  scale(1.22); }
  60%  { transform: translate( 13vw, -10vh)  scale(0.88); }
  85%  { transform: translate( -4vw,  12vh)  scale(1.12); }
  100% { transform: translate(0,      0)     scale(1);    }
}

/* blob4: 28s, slow background depth */
@keyframes blobDrift4 {
  0%   { transform: translate(0,     0)    scale(1);    }
  33%  { transform: translate( 7vw, -5vh)  scale(1.06); }
  66%  { transform: translate(-6vw,  6vh)  scale(0.95); }
  100% { transform: translate(0,     0)    scale(1);    }
}

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* blob1 — purple, top inline-END corner */
.bg-blobs .blob1 {
  position: absolute;
  top: -10vw;
  inset-inline-end: -8vw;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  background: #6B4FA0;
  opacity: .62;
  filter: blur(110px);
  will-change: transform;
  animation: blobDrift1 13s ease-in-out infinite alternate;
}

/* blob2 — silver, bottom inline-START corner */
.bg-blobs .blob2 {
  position: absolute;
  bottom: -10vw;
  inset-inline-start: -8vw;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  background: #D6DCE8;
  opacity: .28;
  filter: blur(95px);
  will-change: transform;
  animation: blobDrift2 17s ease-in-out infinite alternate;
}

/* blob3 — lilac, center */
.bg-blobs .blob3 {
  position: absolute;
  top: 28vh;
  inset-inline-start: 32vw;
  width: 28vw;
  height: 28vw;
  border-radius: 50%;
  background: #966EC8;
  opacity: .42;
  filter: blur(85px);
  will-change: transform;
  animation: blobDrift3 10s ease-in-out infinite alternate;
}

/* blob4 — deep purple, giant background layer */
.bg-blobs .blob4 {
  position: absolute;
  top: 15vh;
  inset-inline-start: 10vw;
  width: 72vw;
  height: 72vw;
  border-radius: 50%;
  background: #3D2A6E;
  opacity: .22;
  filter: blur(140px);
  will-change: transform;
  animation: blobDrift4 28s ease-in-out infinite alternate;
}

/* Light mode: softer opacities */
[data-theme="light"] .bg-blobs .blob1 { opacity: .22; background: #9A7EC8; }
[data-theme="light"] .bg-blobs .blob2 { opacity: .14; background: #D6DCE8; }
[data-theme="light"] .bg-blobs .blob3 { opacity: .15; background: #B89AD6; }
[data-theme="light"] .bg-blobs .blob4 { opacity: .08; background: #8B6FC4; }

/* Mobile: halve travel distances, hide blob3+blob4 for performance */
@media (max-width: 575.98px) {
  @keyframes blobDrift1Mob {
    0%   { transform: translate(0,    0)     scale(1);    }
    20%  { transform: translate(-8vw, -2vh)  scale(1.10); }
    45%  { transform: translate( 7vw, -6vh)  scale(0.90); }
    70%  { transform: translate( 3vw,  7vh)  scale(1.12); }
    100% { transform: translate(0,    0)     scale(1);    }
  }
  @keyframes blobDrift2Mob {
    0%   { transform: translate(0,    0)     scale(1);    }
    25%  { transform: translate( 7vw, -7vh)  scale(1.10); }
    55%  { transform: translate(-6vw,  6vh)  scale(0.92); }
    100% { transform: translate(0,    0)     scale(1);    }
  }
  .bg-blobs .blob1 { animation: blobDrift1Mob 13s ease-in-out infinite alternate; }
  .bg-blobs .blob2 { animation: blobDrift2Mob 17s ease-in-out infinite alternate; }
  .bg-blobs .blob3 { display: none; }
  .bg-blobs .blob4 { display: none; }
}

/* ═══════════════════════════════════════════════════
   Cursor glow (laptop only, JS sets --cx/--cy)
   ═══════════════════════════════════════════════════ */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    380px circle at var(--cx, -999px) var(--cy, -999px),
    rgba(107,79,160,.10) 0%,
    transparent 70%
  );
  transition: background .05s;
}
[data-theme="light"] .cursor-glow {
  background: radial-gradient(
    380px circle at var(--cx, -999px) var(--cy, -999px),
    rgba(107,79,160,.06) 0%,
    transparent 70%
  );
}

/* ── Reduced motion: kill all non-essential ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
