/* =========================================================
   LINKZ – Complete CSS Animation Library
   Version: 2.0 – July 2024
   Purpose: All CSS-only animations, keyframes & utilities
   ========================================================= */

/* ---------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (easy theming)
   --------------------------------------------------------- */
:root {
  --duration-fast:   .3s;
  --duration-normal: .6s;
  --duration-slow:   1s;
  --duration-slower: 2s;

  --easing-default: cubic-bezier(.4,0,.2,1);
  --easing-bounce:  cubic-bezier(.68,-.55,.265,1.55);

  --perspective: 1000px;
  --depth: 60px;
}

/* ---------------------------------------------------------
   2. RESET / PREFERS-REDUCED-MOTION
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------
   3. SCROLL-REVEAL (fade-in-up on scroll)
   --------------------------------------------------------- */
.section-reveal {
  opacity: 0;
  transform: translateY(3rem);
  transition: opacity var(--duration-normal) var(--easing-default),
              transform var(--duration-normal) var(--easing-default);
}
.section-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------
   4. FLOATING 3D ORBS (background ambience)
   --------------------------------------------------------- */
.tech-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .15;
  z-index: -1;
  animation: float3d 20s infinite ease-in-out;
  transform-style: preserve-3d;
}
.orb-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #00BFFF, transparent 70%);
  top: 20%; left: 10%;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #9370DB, transparent 70%);
  bottom: 10%; right: 10%;
  animation-delay: 4s;
}
.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, #FFA500, transparent 70%);
  top: 60%; left: 30%;
  animation-delay: 8s;
}
@keyframes float3d {
  0%,100% { transform: translate3d(0,0,0) rotateY(0); }
  25%   { transform: translate3d(50px,30px,var(--depth)) rotateY(12deg); }
  50%   { transform: translate3d(0,60px,0) rotateY(0); }
  75%   { transform: translate3d(-50px,30px,var(--depth)) rotateY(-12deg); }
}

/* ---------------------------------------------------------
   5. PULSE & GLOW UTILITIES
   --------------------------------------------------------- */
.pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,191,255,.7); }
  70%  { box-shadow: 0 0 0 12px rgba(0,191,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,191,255,0); }
}
.dark .pulse {
  animation: pulse-dark 2s infinite;
}
@keyframes pulse-dark {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,.7); }
  70%  { box-shadow: 0 0 0 12px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

.glow-blue {
  animation: glowBlue 3s ease-in-out infinite alternate;
}
@keyframes glowBlue {
  from { box-shadow: 0 0 5px rgba(0,191,255,.4); }
  to   { box-shadow: 0 0 20px rgba(0,191,255,.9); }
}

/* ---------------------------------------------------------
   6. 3D CARD HOVER EFFECTS
   --------------------------------------------------------- */
.card-3d {
  transform-style: preserve-3d;
  transition: transform .5s ease;
  will-change: transform;
}
@media (hover: hover) {
  .card-3d:hover {
    transform: perspective(var(--perspective)) rotateX(4deg) rotateY(-4deg) scale(1.03);
  }
}

/* ---------------------------------------------------------
   7. BUTTON & LINK MICRO-INTERACTIONS
   --------------------------------------------------------- */
.btn-hover-grow {
  transition: transform var(--duration-fast) var(--easing-default);
}
.btn-hover-grow:hover {
  transform: scale(1.05);
}

.btn-hover-shine {
  position: relative;
  overflow: hidden;
}
.btn-hover-shine::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transition: left var(--duration-fast) ease;
}
.btn-hover-shine:hover::before {
  left: 100%;
}

/* ---------------------------------------------------------
   8. LOADING / SKELETON
   --------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------------------------------------------------------
   9. TEXT & SVG ANIMATIONS
   --------------------------------------------------------- */
.typewriter {
  overflow: hidden;
  border-right: .15em solid #00BFFF;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}
@keyframes typing {
  from { width: 0 }
  to   { width: 100% }
}
@keyframes blink-caret {
  from, to { border-color: transparent }
  50%      { border-color: #00BFFF }
}

/* ---------------------------------------------------------
  10. MOBILE NAVIGATION ANIMATIONS
  --------------------------------------------------------- */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu.active {
  animation: slideDown var(--duration-fast) var(--easing-default);
}

/* ---------------------------------------------------------
  11. SCROLL PROGRESS BAR
  --------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #00BFFF, #9370DB);
  transition: width .25s linear;
  z-index: 9999;
}

/* ---------------------------------------------------------
  12. RESPONSIVE ADJUSTMENTS
  --------------------------------------------------------- */
@media (max-width: 768px) {
  .tech-orb { display: none; }
  .section-reveal { transition-duration: .3s; }
}

/* ---------------------------------------------------------
  13. UTILITIES / HELPER CLASSES
  --------------------------------------------------------- */
.animate-fade-in   { animation: fadeIn   var(--duration-normal) ease both; }
.animate-fade-up  { animation: fadeUp   var(--duration-normal) ease both; }
.animate-slide-in { animation: slideIn  var(--duration-normal) ease both; }

@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(2rem) } to { opacity: 1; transform: translateY(0) } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-2rem) } to { opacity: 1; transform: translateX(0) } }

/* ---------------------------------------------------------
  14. PRINT & PREFERS-REDUCED-MOTION
  --------------------------------------------------------- */
@media print {
  * { animation: none !important; transition: none !important; }
}