/* ============================================================
   05-animations.css — Kurvin Motion
   ============================================================ */

/* ── Page Transitions ────────────────────────────────────────
   Slide left/right. No blur. Fast.
   ──────────────────────────────────────────────────────────── */

@keyframes pageEnter {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pageExit {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-16px); }
}

.page-enter { animation: pageEnter var(--dur-slow) var(--ease-out) both; }
.page-exit  { animation: pageExit var(--dur-normal) var(--ease-in) both; }

/* ── Loading Screen ──────────────────────────────────────────
   JS controls the logo layer sequencing (setTimeout).
   CSS only handles layout + initial states.
   ──────────────────────────────────────────────────────────── */

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--color-bg);
  background-image: var(--noise-url);
}

.logo-layer-tag  { opacity: 0; }
.logo-layer-full { opacity: 0; }
.loading-wordmark { opacity: 0; }

/* ── Card stagger ────────────────────────────────────────────
   JS sets --index on each child.
   ──────────────────────────────────────────────────────────── */

.stagger-children > * {
  animation: staggerIn 0.4s var(--ease-out) both;
  animation-delay: calc(0.05s * var(--index, 0));
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Shimmer / Skeleton ──────────────────────────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-surface)    25%,
    var(--color-bg-surface-2)  50%,
    var(--color-bg-surface)    75%
  );
  background-size: 200% auto;
  animation: shimmer 1.6s linear infinite;
}

/* ── Spray drip button hover ─────────────────────────────────
   ::after pseudo slides down from top on hover.
   ──────────────────────────────────────────────────────────── */

.btn-drip {
  position: relative;
  overflow: hidden;
}

.btn-drip::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: rgba(255, 255, 255, 0.12);
  transition: height var(--dur-normal) var(--ease-out);
  pointer-events: none;
}

.btn-drip:hover::after { height: 100%; }

/* ── Fade in ─────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-fade-in { animation: fadeIn var(--dur-normal) ease both; }

/* ── Slide in right (settings, detail panels) ────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

/* ── Slide up (toasts, overlays) ─────────────────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Spin ────────────────────────────────────────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.anim-spin { animation: spin 0.8s linear infinite; }

/* ── Pulse glow (accent elements) ───────────────────────────
   ──────────────────────────────────────────────────────────── */

@keyframes accentPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 20, 147, 0); }
  50%       { box-shadow: var(--shadow-accent-strong); }
}

.anim-accent-pulse { animation: accentPulse 2.5s ease-in-out infinite; }
