/* ============================================================
   Nivaas Foundations - Animations & Keyframes
   ============================================================ */

/* ---------- Keyframes ---------- */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 8px 25px rgba(37,211,102,0.4); }
  50% { box-shadow: 0 8px 35px rgba(37,211,102,0.65), 0 0 0 10px rgba(37,211,102,0.08); }
}

@keyframes bounce-scroll {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

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

@keyframes float-up-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes blob-morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes slide-in-left {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-right {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fade-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scale-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes text-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(91, 107, 125,0.3); }
  50% { text-shadow: 0 0 25px rgba(91, 107, 125,0.7), 0 0 50px rgba(91, 107, 125,0.3); }
}

@keyframes count-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes particle-float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* ---------- Animation Classes ---------- */
.anim-float { animation: float-up-down 4s ease-in-out infinite; }
.anim-rotate { animation: rotate-slow 20s linear infinite; }
.anim-blob { animation: blob-morph 8s ease-in-out infinite; }
.anim-glow { animation: text-glow 3s ease-in-out infinite; }
.anim-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* ---------- Hover Transitions ---------- */
.hover-lift { transition: transform 0.35s cubic-bezier(0.25,0.8,0.25,1); }
.hover-lift:hover { transform: translateY(-8px); }

.hover-scale { transition: transform 0.35s ease; }
.hover-scale:hover { transform: scale(1.04); }

.hover-glow {
  transition: box-shadow 0.35s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(27,79,140,0.25), 0 8px 35px rgba(27,79,140,0.15);
}

/* ---------- Reveal on Scroll (manual, backup for AOS) ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.7s cubic-bezier(0.25,0.8,0.25,1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-50px); transition: all 0.7s ease; }
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(50px); transition: all 0.7s ease; }
.reveal-right.revealed { opacity: 1; transform: translateX(0); }

/* ---------- Stagger Delays ---------- */
.delay-1 { transition-delay: 0.1s !important; animation-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; animation-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; animation-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; animation-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; animation-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; animation-delay: 0.6s !important; }

/* ---------- Background Blobs ---------- */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: blob-morph 10s ease-in-out infinite;
}

.bg-blob-1 {
  width: 400px; height: 400px;
  background: rgba(27,79,140,0.08);
  top: -100px; left: -100px;
}

.bg-blob-2 {
  width: 300px; height: 300px;
  background: rgba(91, 107, 125,0.06);
  bottom: -80px; right: -80px;
  animation-delay: -5s;
}

/* ---------- Particles Container ---------- */
#particles-js {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Typing Cursor ---------- */
.typing-cursor::after {
  content: '|';
  display: inline-block;
  animation: blink-cursor 1s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Page Transition ---------- */
/* Hidden by default — JS can animate it in on navigation, not needed to show content */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--dark);
  z-index: 9998;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
  pointer-events: none;
}

#page-transition.hidden {
  transform: scaleY(0);
  transform-origin: bottom;
}

/* ---------- Body loading state ---------- */
body.loading {
  overflow: hidden;
}

/* ---------- Gradient Borders ---------- */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Ripple Effect ---------- */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

.ripple-effect:active::after {
  animation: ripple 0.6s ease-out;
}

/* ---------- Shimmer Overlay (Skeleton) ---------- */
.skeleton-text {
  height: 16px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-img {
  width: 100%; height: 220px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

/* ---------- Mouse Cursor (custom) ---------- */
.cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 2px solid rgba(91, 107, 125,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, transform 0.15s ease;
}

.cursor-ring.hover {
  width: 52px; height: 52px;
  border-color: var(--primary);
  background: rgba(27,79,140,0.05);
}

/* ---------- 3D Card Tilt ---------- */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* ---------- Image Lazy Load Fade ---------- */
img.lazy {
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.lazy.loaded { opacity: 1; }

/* ============================================================
   PREMIUM IMAGE EFFECTS — Project & Product Cards
   ============================================================ */

/* Shine sweep keyframe */
@keyframes img-shine {
  0%   { left: -120%; }
  100% { left: 160%; }
}

/* Shine pseudo-element on both card types */
.project-img-wrap::before,
.product-img-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  z-index: 3;
  pointer-events: none;
}

/* Trigger shine on hover */
.project-card:hover .project-img-wrap::before,
.product-card:hover .product-img-wrap::before {
  animation: img-shine 0.7s ease forwards;
}

/* Premium gold-glow border on project card hover */
.project-card:hover {
  box-shadow:
    0 24px 60px rgba(27, 79, 140, 0.22),
    0 0 0 1px rgba(91, 107, 125, 0.28),
    0 0 35px rgba(91, 107, 125, 0.08);
}

/* Premium glow on product card hover */
.product-card:hover {
  box-shadow:
    0 28px 65px rgba(27, 79, 140, 0.28),
    0 0 0 1px rgba(91, 107, 125, 0.32),
    0 0 45px rgba(91, 107, 125, 0.10);
}

/* Subtle brightness + saturation lift on image hover */
.project-img-wrap img {
  transition: transform 0.7s ease, filter 0.4s ease;
}
.project-card:hover .project-img-wrap img {
  filter: brightness(1.06) saturate(1.1);
}

.product-img-wrap img {
  transition: transform 0.6s ease, filter 0.4s ease;
}
.product-card:hover .product-img-wrap img {
  filter: brightness(1.07) saturate(1.15);
}

/* Glassmorphism on project category badge */
.project-category-tag {
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
}

/* Glassmorphism on project overlay */
.project-overlay {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
