/* ═══════════════════════════════════════════════════════════
   YAHYA.DEV — ANIMATIONS CSS
   Keyframes · Entrance · Hover FX · Parallax · Special
═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════
   CORE KEYFRAMES
══════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeRight {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ══════════════════════════════
   GLOW / PULSE EFFECTS
══════════════════════════════ */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.2); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.5), 0 0 80px rgba(6,182,212,0.2); }
}
@keyframes glow-cyan {
  0%, 100% { box-shadow: 0 0 20px rgba(6,182,212,0.2); }
  50%       { box-shadow: 0 0 50px rgba(6,182,212,0.5), 0 0 100px rgba(6,182,212,0.2); }
}
@keyframes text-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(99,102,241,0.4); }
  50%       { text-shadow: 0 0 40px rgba(6,182,212,0.6), 0 0 80px rgba(99,102,241,0.3); }
}

/* ══════════════════════════════
   FLOAT / LEVITATE
══════════════════════════════ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes float-sm {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes float-rotate {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-10px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* ══════════════════════════════
   GRADIENT ANIMATIONS
══════════════════════════════ */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes gradient-rotate {
  from { --angle: 0deg; }
  to   { --angle: 360deg; }
}

/* Animated gradient text */
.text-animated-gradient {
  background: linear-gradient(
    135deg,
    var(--indigo-l),
    var(--cyan-l),
    var(--purple-l),
    var(--indigo-l)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

/* ══════════════════════════════
   TYPING CURSOR
══════════════════════════════ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s ease infinite;
}

/* ══════════════════════════════
   SCROLL INDICATOR
══════════════════════════════ */
@keyframes scroll-down {
  0%    { transform: scaleY(0); transform-origin: top; opacity: 1; }
  45%   { transform: scaleY(1); transform-origin: top; opacity: 1; }
  55%   { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100%  { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
.scroll-indicator {
  position: absolute;
  bottom: var(--space-7);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-out) 3s forwards;
}
.scroll-indicator-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scroll-indicator-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--indigo), transparent);
  animation: scroll-down 2s ease infinite;
}

/* ══════════════════════════════
   ORBIT / SPIN
══════════════════════════════ */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}
.spin-slow   { animation: spin-slow 20s linear infinite; }
.spin-reverse{ animation: spin-reverse 15s linear infinite; }

/* ══════════════════════════════
   HERO SECTION BG IMAGES
══════════════════════════════ */
.section-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.section-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.section-bg-overlay {
  position: absolute;
  inset: 0;
}

/* Hero bg */
.hero-bg-overlay {
  background:
    linear-gradient(to bottom,
      rgba(2,2,8,0.3) 0%,
      rgba(2,2,8,0.6) 40%,
      rgba(2,2,8,0.95) 100%),
    linear-gradient(to right,
      rgba(2,2,8,0.8) 0%,
      transparent 60%);
}

/* About bg */
.about-bg-overlay {
  background:
    linear-gradient(135deg,
      rgba(2,2,8,0.92) 0%,
      rgba(2,2,8,0.75) 50%,
      rgba(2,2,8,0.92) 100%);
}

/* Skills bg */
.skills-bg-overlay {
  background:
    linear-gradient(180deg,
      rgba(2,2,8,0.88) 0%,
      rgba(6,6,18,0.82) 50%,
      rgba(2,2,8,0.92) 100%);
  mix-blend-mode: multiply;
}

/* Contact bg */
.contact-bg-overlay {
  background:
    linear-gradient(135deg,
      rgba(2,2,8,0.85) 0%,
      rgba(10,10,24,0.75) 50%,
      rgba(2,2,8,0.92) 100%);
}

/* Parallax container */
.parallax-wrap {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ══════════════════════════════
   CARD HOVER EFFECTS
══════════════════════════════ */
/* Shimmer sweep */
.shimmer-card {
  position: relative;
  overflow: hidden;
}
.shimmer-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -75%;
  width: 50%; height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255,255,255,0.04) 50%,
    transparent 100%
  );
  transform: skewX(-15deg);
  opacity: 0;
  transition: opacity 0.1s;
}
.shimmer-card:hover::after {
  opacity: 1;
  animation: shimmer-sweep 0.6s var(--ease-out) forwards;
}
@keyframes shimmer-sweep {
  from { left: -75%; }
  to   { left: 125%; }
}

/* ══════════════════════════════
   IMAGE REVEAL
══════════════════════════════ */
@keyframes img-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0% 0 0);
  }
}
.img-reveal {
  animation: img-reveal 0.8s var(--ease-out) forwards;
}

/* ══════════════════════════════
   NUMBER COUNT UP
══════════════════════════════ */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════
   STATS / COUNTERS
══════════════════════════════ */
.stat-card {
  text-align: center;
  padding: var(--space-7) var(--space-6);
}
.stat-card-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
}
.stat-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ══════════════════════════════
   MARQUEE / TICKER
══════════════════════════════ */
.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}
.marquee-wrap::before,
.marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-base), transparent);
}
.marquee-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-base), transparent);
}
.marquee-track {
  display: inline-flex;
  gap: var(--space-7);
  animation: marquee 30s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.marquee-item-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--indigo);
}

/* ══════════════════════════════
   BACKGROUND MESH / GRID
══════════════════════════════ */
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}
.bg-grid-fade {
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
}

/* Radial spotlight */
.bg-spotlight {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(99,102,241,0.08) 0%,
    transparent 70%
  );
}

/* ══════════════════════════════
   TECH STACK ICONS
══════════════════════════════ */
.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  transition: border-color var(--dur-base),
              color var(--dur-base),
              background var(--dur-base),
              transform var(--dur-base) var(--ease-spring);
}
.tech-pill:hover {
  border-color: var(--indigo);
  color: var(--indigo-l);
  background: rgba(99,102,241,0.08);
  transform: translateY(-2px);
}

/* ══════════════════════════════
   COUNTER ANIMATION
══════════════════════════════ */
@keyframes countUp {
  0%   { transform: translateY(8px) scale(0.9); opacity: 0; }
  60%  { transform: translateY(-3px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.stat-num.counting,
.stats-bar-num.counting,
.about-exp-num.counting,
.logo-popup-stat-num.counting {
  animation: countUp 0.5s var(--ease-spring) forwards;
  display: inline-block;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.8; }
}
.skeleton {
  background: var(--bg-card-2);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease infinite;
}

/* ══════════════════════════════
   PAGE TRANSITION
══════════════════════════════ */
.page-transition-overlay {
  position: fixed; inset: 0;
  z-index: 9998;
  background: var(--bg-base);
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
.page-transition-overlay.enter {
  animation: page-enter 0.4s var(--ease-out) forwards;
}
.page-transition-overlay.exit {
  animation: page-exit 0.4s var(--ease-out) forwards;
}
@keyframes page-enter {
  from { transform: scaleY(0); transform-origin: bottom; }
  to   { transform: scaleY(1); transform-origin: bottom; }
}
@keyframes page-exit {
  from { transform: scaleY(1); transform-origin: top; }
  to   { transform: scaleY(0); transform-origin: top; }
}

/* ══════════════════════════════
   UTILITY ANIMATIONS
══════════════════════════════ */
.anim-float    { animation: float     4s ease-in-out infinite; }
.anim-float-sm { animation: float-sm  3s ease-in-out infinite; }
.anim-glow     { animation: glow-pulse 3s ease-in-out infinite; }
.anim-glow-cyan{ animation: glow-cyan  3s ease-in-out infinite; }
.anim-text-glow{ animation: text-glow  3s ease-in-out infinite; }

/* Delay utilities */
.anim-d1 { animation-delay: 0.1s; }
.anim-d2 { animation-delay: 0.2s; }
.anim-d3 { animation-delay: 0.3s; }
.anim-d5 { animation-delay: 0.5s; }
.anim-d7 { animation-delay: 0.7s; }
.anim-d10{ animation-delay: 1.0s; }

/* Duration utilities */
.dur-fast  { animation-duration: 2s !important; }
.dur-slow  { animation-duration: 6s !important; }
.dur-xslow { animation-duration: 10s !important; }
