/* ============================================================
   Dorojay.com — Keyframe Animations  v2.0
   ============================================================ */

/* ── Fade In ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

/* ── Slide ────────────────────────────────────────────── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* ── Scale ────────────────────────────────────────────── */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.75); }
  60%  { transform: scale(1.08); }
  80%  { transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Glow Pulse ───────────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(245,158,11,0.3); }
  50%       { box-shadow: 0 0 44px rgba(245,158,11,0.65), 0 0 64px rgba(6,182,212,0.3); }
}

@keyframes cyanGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(6,182,212,0.2); }
  50%       { box-shadow: 0 0 44px rgba(6,182,212,0.55); }
}

@keyframes goldPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(245,158,11,0.4); }
  50%       { text-shadow: 0 0 24px rgba(245,158,11,0.8), 0 0 40px rgba(245,158,11,0.3); }
}

/* ── Floating ─────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(2deg); }
  66%       { transform: translateY(-5px) rotate(-1.5deg); }
}

@keyframes floatSide {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(10px); }
}

/* ── Pulse Dot ────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(6,182,212,0.4); }
  50%       { opacity: 0.6; transform: scale(0.82); box-shadow: 0 0 0 5px rgba(6,182,212,0); }
}

/* ── Spin ─────────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Shimmer (skeleton loading) ────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

/* ── Count Up ─────────────────────────────────────────── */
@keyframes countPulse {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Toast ────────────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.88) translateY(8px); }
}

/* ── Border Gradient Rotate ────────────────────────────── */
@keyframes borderRotate {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Gradient Shift ────────────────────────────────────── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Badge Pulse ──────────────────────────────────────── */
@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.06); opacity: 0.85; }
}

/* ── Bounce ───────────────────────────────────────────── */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  40%  { opacity: 1; transform: scale(1.1); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ── Ripple ───────────────────────────────────────────── */
@keyframes ripple {
  to { transform: scale(3); opacity: 0; }
}

/* ── Stagger children ─────────────────────────────────── */
@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility animation classes ─────────────────────────── */
.animate-fadeIn      { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp    { animation: fadeInUp 0.65s ease forwards; }
.animate-fadeInDown  { animation: fadeInDown 0.5s ease forwards; }
.animate-fadeInLeft  { animation: fadeInLeft 0.6s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease forwards; }
.animate-scaleIn     { animation: scaleIn 0.4s ease forwards; }
.animate-popIn       { animation: popIn 0.5s ease forwards; }
.animate-float       { animation: float 4s ease-in-out infinite; }
.animate-floatSlow   { animation: floatSlow 6s ease-in-out infinite; }
.animate-glowPulse   { animation: glowPulse 3s ease-in-out infinite; }
.animate-cyanGlow    { animation: cyanGlow 3s ease-in-out infinite; }
.animate-spin        { animation: spin 1s linear infinite; }
.animate-goldPulse   { animation: goldPulse 2.5s ease-in-out infinite; }
.animate-badgePulse  { animation: badgePulse 2s ease-in-out infinite; }
.animate-bounceIn    { animation: bounceIn 0.6s ease forwards; }

/* Delay helpers */
.delay-50  { animation-delay: 0.05s; }
.delay-100 { animation-delay: 0.1s; }
.delay-150 { animation-delay: 0.15s; }
.delay-200 { animation-delay: 0.2s; }
.delay-250 { animation-delay: 0.25s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Hidden until animated */
.will-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.will-animate.in-view {
  opacity: 1;
  transform: translateY(0);
}
.will-animate.from-left {
  transform: translateX(-24px);
}
.will-animate.from-left.in-view {
  transform: translateX(0);
}
.will-animate.from-right {
  transform: translateX(24px);
}
.will-animate.from-right.in-view {
  transform: translateX(0);
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg,
    #f1f5f9 0%,
    #e2e8f0 50%,
    #f1f5f9 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 16px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-text.sm { height: 13px; width: 60%; }
.skeleton-img  { aspect-ratio: 1; width: 100%; }

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(0,0,0,0.08);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}
.spinner.lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

/* Page transition overlay */
.page-transition {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.page-transition.entering { opacity: 1; }

/* Hero entry animations — initial hide applied by JS to avoid blank page if JS fails */
.hero-content.js-ready > * {
  opacity: 0;
  transform: translateY(28px);
}
.hero-content.loaded > *:nth-child(1) { animation: fadeInUp 0.75s 0.08s ease forwards; }
.hero-content.loaded > *:nth-child(2) { animation: fadeInUp 0.75s 0.22s ease forwards; }
.hero-content.loaded > *:nth-child(3) { animation: fadeInUp 0.75s 0.36s ease forwards; }
.hero-content.loaded > *:nth-child(4) { animation: fadeInUp 0.75s 0.50s ease forwards; }
.hero-content.loaded > *:nth-child(5) { animation: fadeInUp 0.75s 0.64s ease forwards; }
.hero-content.loaded > *:nth-child(6) { animation: fadeInUp 0.75s 0.78s ease forwards; }

/* Stagger grid children */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.19s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.26s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.33s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.40s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.47s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.54s; }
