/* =============================================
   PORTFOLIO ANIMATIONS - Global Animation Layer
   ============================================= */

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for child cards */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.35s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.45s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.55s; }

/* ---------- Typing Cursor ---------- */
.typing-cursor::after {
  content: '|';
  animation: blink 0.75s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Hero Portrait Glow Ring ---------- */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.5), 0 0 40px rgba(108, 92, 231, 0.2);
    border-color: #6c5ce7;
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 111, 97, 0.7), 0 0 60px rgba(255, 111, 97, 0.3);
    border-color: #ff6f61;
  }
}
.portrait {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ---------- Floating Tech Icons ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.icon-box:nth-child(1) { animation: float 3.0s ease-in-out infinite; }
.icon-box:nth-child(2) { animation: float 3.4s ease-in-out infinite 0.2s; }
.icon-box:nth-child(3) { animation: float 2.8s ease-in-out infinite 0.4s; }
.icon-box:nth-child(4) { animation: float 3.2s ease-in-out infinite 0.6s; }
.icon-box:nth-child(5) { animation: float 3.6s ease-in-out infinite 0.8s; }
.icon-box:nth-child(6) { animation: float 2.9s ease-in-out infinite 1.0s; }
.icon-box:nth-child(7) { animation: float 3.3s ease-in-out infinite 1.2s; }

/* ---------- Animated Progress Bars (handled in Skills.css) ---------- */

/* ---------- Card Glow Hover (non-carousel only) ---------- */
.blur-card:not(.exp-card):not(.project-card) {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease !important;
}
.blur-card:not(.exp-card):not(.project-card):hover {
  transform: translateY(-5px) scale(1.015) !important;
  box-shadow: 0 0 28px rgba(108, 92, 231, 0.4), 0 10px 28px rgba(0,0,0,0.3) !important;
  border-color: var(--primary) !important;
}

/* ---------- Social Card Glow ---------- */
.social-card:hover .social-icon i {
  animation: iconBounce 0.5s ease;
}
@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ---------- Navbar Scroll Shrink ---------- */
.navbar {
  transition: padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
  padding: 4px 0 !important;
  background: rgba(15, 12, 41, 0.92) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* ---------- Section Heading Underline Animate ---------- */
.section-heading {
  position: relative;
  display: inline-block;
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.8s ease 0.3s;
}
.section-heading.visible::after {
  width: 100%;
}

/* ---------- Cursor Trail ---------- */
.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;
  mix-blend-mode: screen;
}
.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(108, 92, 231, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: left 0.12s ease, top 0.12s ease, width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}
.cursor-ring.hovered {
  width: 50px;
  height: 50px;
  border-color: var(--accent);
}

/* ---------- Hero Subhead Fade (handled in Hero.css) ---------- */

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Hero Buttons Pop (handled in Hero.css) ---------- */

/* ---------- Skill Card Active State ---------- */
.skill-card.active {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.4) !important;
  transform: scale(1.02);
}

/* ---------- Project Card Slide ---------- */
.carousel-item {
  transition: transform 0.6s ease, opacity 0.6s ease !important;
}

/* Carousel cards should only lift downward to avoid clipping top border */
.carousel .blur-card:hover {
  transform: translateY(4px) scale(1.01) !important;
  box-shadow: 0 0 25px rgba(108, 92, 231, 0.45), 0 8px 20px rgba(0,0,0,0.3) !important;
}

/* ---------- Page Load Fade In ---------- */
@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
body {
  animation: pageFadeIn 0.6s ease forwards;
}
