/* ================================
   YRUG CODERS - WARM-TECH ANIMATIONS
   Advanced SVG & Interactive Effects
   ================================ */

/* Warm-Tech Animation Variables */
:root {
  --amber-glow: rgba(255, 184, 76, 0.6);
  --coral-glow: rgba(255, 107, 107, 0.6);
  --mint-glow: rgba(62, 213, 152, 0.6);
}

/* Typing Animation for Hero */
.typing-text {
  animation: warm-typing 3s steps(40, end),
    warm-typing-cursor 0.75s step-end infinite;
}

.typing-text[data-delay="2000"] {
  animation-delay: 2s;
}

.typing-text[data-delay="4000"] {
  animation-delay: 4s;
}

@keyframes warm-typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes warm-typing-cursor {
  0%,
  50% {
    border-color: #ffb84c;
  }
  51%,
  100% {
    border-color: transparent;
  }
}

/* Hero Background Animations */
.nodes-container .node {
  animation: warm-node-glow 3s ease-in-out infinite alternate;
}

.node-1 {
  animation-delay: 0s;
}
.node-2 {
  animation-delay: 0.5s;
}
.node-3 {
  animation-delay: 1s;
}
.node-4 {
  animation-delay: 1.5s;
}
.node-5 {
  animation-delay: 2s;
}
.node-6 {
  animation-delay: 2.5s;
}
.node-7 {
  animation-delay: 3s;
}
.node-8 {
  animation-delay: 3.5s;
}

@keyframes warm-node-glow {
  0% {
    r: 3;
    opacity: 0.7;
    filter: drop-shadow(0 0 8px var(--amber-glow));
  }
  100% {
    r: 6;
    opacity: 1;
    filter: drop-shadow(0 0 18px var(--amber-glow));
  }
}

.connection {
  stroke-dasharray: 10 5;
  animation: connection-pulse 4s linear infinite;
}

.connection-1 {
  animation-delay: 0s;
}
.connection-2 {
  animation-delay: 0.5s;
}
.connection-3 {
  animation-delay: 1s;
}
.connection-4 {
  animation-delay: 1.5s;
}
.connection-5 {
  animation-delay: 2s;
}
.connection-6 {
  animation-delay: 2.5s;
}
.connection-7 {
  animation-delay: 3s;
}

@keyframes warm-connection-pulse {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.4;
    stroke-width: 1;
    filter: drop-shadow(0 0 5px var(--mint-glow));
  }
  50% {
    opacity: 0.9;
    stroke-width: 2;
    filter: drop-shadow(0 0 12px var(--mint-glow));
  }
  100% {
    stroke-dashoffset: 30;
    opacity: 0.4;
    stroke-width: 1;
    filter: drop-shadow(0 0 5px var(--mint-glow));
  }
}

/* Particle Flow Animation */
.particle-1 {
  animation: particle-path-1 6s ease-in-out infinite;
}

.particle-2 {
  animation: particle-path-2 8s ease-in-out infinite;
  animation-delay: 2s;
}

.particle-3 {
  animation: particle-path-3 7s ease-in-out infinite;
  animation-delay: 4s;
}

@keyframes particle-path-1 {
  0% {
    cx: 200;
    cy: 150;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  25% {
    cx: 400;
    cy: 200;
  }
  50% {
    cx: 800;
    cy: 250;
  }
  75% {
    cx: 1200;
    cy: 120;
  }
  90% {
    opacity: 1;
  }
  100% {
    cx: 1600;
    cy: 180;
    opacity: 0;
  }
}

@keyframes particle-path-2 {
  0% {
    cx: 1600;
    cy: 180;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  25% {
    cx: 1200;
    cy: 120;
  }
  50% {
    cx: 800;
    cy: 250;
  }
  75% {
    cx: 400;
    cy: 200;
  }
  90% {
    opacity: 1;
  }
  100% {
    cx: 200;
    cy: 150;
    opacity: 0;
  }
}

@keyframes particle-path-3 {
  0% {
    cx: 600;
    cy: 100;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  30% {
    cx: 1000;
    cy: 180;
  }
  60% {
    cx: 1400;
    cy: 300;
  }
  90% {
    opacity: 1;
  }
  100% {
    cx: 200;
    cy: 150;
    opacity: 0;
  }
}

/* About Section Animations */
.hexagon-grid .hex {
  animation: hex-appear 1s ease-out forwards;
  opacity: 0;
  transform: scale(0.5);
}

.hex-1 {
  animation-delay: 0.2s;
}
.hex-2 {
  animation-delay: 0.4s;
}
.hex-3 {
  animation-delay: 0.6s;
}
.hex-4 {
  animation-delay: 0.8s;
}

@keyframes hex-appear {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.1) rotate(-90deg);
  }
  100% {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
  }
}

.cube-container {
  animation: cube-float 4s ease-in-out infinite;
}

.cube {
  animation: cube-rotate 6s linear infinite;
}

@keyframes cube-float {
  0%,
  100% {
    transform: translate(200px, 200px) translateY(0px);
  }
  50% {
    transform: translate(200px, 200px) translateY(-20px);
  }
}

@keyframes cube-rotate {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

/* Counter Animation for Stats */
.stat-number {
  animation: count-up 2s ease-out forwards;
}

@keyframes count-up {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Service Icons Animations */
.service-card:hover .code-lines .code-line {
  animation: code-typing 1.5s ease-in-out forwards;
}

@keyframes code-typing {
  0% {
    stroke-dasharray: 0 100;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dasharray: 100 0;
    opacity: 1;
  }
}

.service-card:hover .app-elements > * {
  animation: app-ui-build 2s ease-out forwards;
}

.app-elements rect:nth-child(1) {
  animation-delay: 0.2s;
}
.app-elements circle:nth-child(2) {
  animation-delay: 0.4s;
}
.app-elements circle:nth-child(3) {
  animation-delay: 0.6s;
}
.app-elements circle:nth-child(4) {
  animation-delay: 0.8s;
}
.app-elements rect:nth-child(5) {
  animation-delay: 1s;
}
.app-elements rect:nth-child(6) {
  animation-delay: 1.2s;
}

@keyframes app-ui-build {
  0% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2) rotate(90deg);
  }
  100% {
    opacity: 0.7;
    transform: scale(1) rotate(0deg);
  }
}

.service-card:hover .gear-system .gear {
  animation: gear-spin 3s linear infinite;
}

.gear-1 {
  animation-direction: normal;
}

.gear-2 {
  animation-direction: reverse;
  animation-delay: 0.5s;
}

@keyframes gear-spin {
  0% {
    transform: translate(var(--x, 0), var(--y, 0)) rotate(0deg);
  }
  100% {
    transform: translate(var(--x, 0), var(--y, 0)) rotate(360deg);
  }
}

.gear-1 {
  --x: 40px;
  --y: 50px;
}
.gear-2 {
  --x: 60px;
  --y: 50px;
}

.service-card:hover .data-flow .data-point {
  animation: data-pulse 2s ease-in-out infinite;
}

.service-card:hover .data-path {
  animation: data-stream 3s ease-in-out infinite;
}

@keyframes data-pulse {
  0%,
  100% {
    r: 2;
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--coral-glow));
  }
  50% {
    r: 4;
    opacity: 0.7;
    filter: drop-shadow(0 0 15px var(--coral-glow));
  }
}

@keyframes data-stream {
  0% {
    stroke-dasharray: 0 50;
    opacity: 0.5;
  }
  50% {
    stroke-dasharray: 25 25;
    opacity: 1;
  }
  100% {
    stroke-dasharray: 50 0;
    opacity: 0.5;
  }
}

/* Project Cards Circuit Animation */
.project-card .circuit-line {
  stroke-dasharray: 5 5;
  animation: circuit-trace 2s ease-in-out infinite;
}

@keyframes circuit-trace {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.3;
    stroke-width: 1;
  }
  50% {
    opacity: 1;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px var(--mint-glow));
  }
  100% {
    stroke-dashoffset: 20;
    opacity: 0.3;
    stroke-width: 1;
  }
}

.project-card .circuit-node {
  animation: circuit-node-glow 1.5s ease-in-out infinite alternate;
}

@keyframes circuit-node-glow {
  0% {
    r: 3;
    opacity: 0.7;
    filter: drop-shadow(0 0 5px var(--mint-glow));
  }
  100% {
    r: 5;
    opacity: 1;
    filter: drop-shadow(0 0 15px var(--mint-glow));
  }
}

/* Tech Stack Orbit Animations */
.orbit {
  border: 2px solid rgba(255, 184, 76, 0.2);
  position: relative;
}

.orbit::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 184, 76, 0.5) 90deg,
    transparent 180deg,
    rgba(255, 107, 107, 0.5) 270deg,
    transparent 360deg
  );
  animation: orbit-glow 4s linear infinite;
  z-index: -1;
}

@keyframes orbit-glow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.tech-item {
  position: relative;
  overflow: hidden;
}

.tech-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 184, 76, 0.6) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.tech-item:hover::before {
  width: 120px;
  height: 120px;
}

.tech-item svg {
  transition: all 0.3s ease;
}

.tech-item:hover svg {
  transform: scale(1.1) rotate(10deg);
  filter: drop-shadow(0 0 10px currentColor);
}

/* Testimonial Avatar Animations */
.avatar-eye {
  animation: eye-blink 4s ease-in-out infinite;
}

.left-eye {
  animation-delay: 0s;
}

.right-eye {
  animation-delay: 0.1s;
}

@keyframes eye-blink {
  0%,
  85%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  90%,
  95% {
    opacity: 0.3;
    transform: scaleY(0.3);
  }
}

.testimonial-card:hover .avatar-head {
  animation: head-nod 2s ease-in-out infinite;
}

@keyframes head-nod {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.testimonial-card .avatar-bg {
  animation: avatar-pulse 3s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%,
  100% {
    stroke-width: 2;
    filter: drop-shadow(0 0 5px var(--mint-glow));
  }
  50% {
    stroke-width: 3;
    filter: drop-shadow(0 0 15px var(--mint-glow));
  }
}

/* Contact Form Input Glow */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  animation: input-glow 2s ease-in-out infinite;
}

@keyframes input-glow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 184, 76, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 184, 76, 0.6);
  }
}

.contact .code-text {
  animation: code-drift 15s linear infinite;
}

.code-text:nth-child(odd) {
  animation-duration: 12s;
  animation-direction: reverse;
}

.code-text:nth-child(even) {
  animation-duration: 18s;
}

@keyframes code-drift {
  0% {
    opacity: 0.1;
    transform: translateX(-50px) translateY(0);
  }
  25% {
    opacity: 0.3;
    transform: translateX(0) translateY(-20px);
  }
  50% {
    opacity: 0.6;
    transform: translateX(30px) translateY(-10px);
  }
  75% {
    opacity: 0.3;
    transform: translateX(10px) translateY(-30px);
  }
  100% {
    opacity: 0.1;
    transform: translateX(-50px) translateY(-50px);
  }
}

/* Footer Matrix Animation */
.matrix-char {
  animation: matrix-rain 8s linear infinite;
}

.matrix-char:nth-child(2n) {
  animation-delay: 1s;
  animation-duration: 6s;
}

.matrix-char:nth-child(3n) {
  animation-delay: 2s;
  animation-duration: 10s;
}

.matrix-char:nth-child(4n) {
  animation-delay: 3s;
  animation-duration: 7s;
}

@keyframes matrix-rain {
  0% {
    opacity: 0;
    transform: translateY(-100px);
  }
  10% {
    opacity: 1;
    fill: #00ff00;
  }
  20% {
    fill: var(--accent-mint);
  }
  80% {
    opacity: 1;
    fill: var(--accent-mint);
  }
  90% {
    fill: #008800;
  }
  100% {
    opacity: 0;
    transform: translateY(600px);
    fill: #004400;
  }
}

/* Social Icons Hover Effects */
.social-link {
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(255, 184, 76, 0.4) 0%,
    transparent 70%
  );
  border-radius: 50%;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.social-link:hover::before {
  width: 80px;
  height: 80px;
}

.social-icon {
  transition: all 0.3s ease;
}

.social-link:hover .social-icon {
  transform: scale(1.2) rotate(15deg);
  filter: drop-shadow(0 0 10px var(--amber-glow));
}

/* Scroll-triggered animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.fade-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.fade-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease;
}

.scale-in.animate {
  opacity: 1;
  transform: scale(1);
}

/* Staggered animations for grids */
.stagger-animate > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.stagger-animate.animate > *:nth-child(1) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.1s;
}

.stagger-animate.animate > *:nth-child(2) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.2s;
}

.stagger-animate.animate > *:nth-child(3) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.3s;
}

.stagger-animate.animate > *:nth-child(4) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.4s;
}

.stagger-animate.animate > *:nth-child(5) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.5s;
}

.stagger-animate.animate > *:nth-child(6) {
  animation: stagger-in 0.6s ease forwards;
  animation-delay: 0.6s;
}

@keyframes stagger-in {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Warm-Tech Specific Animations */
@keyframes warm-glow-pulse {
  0% {
    box-shadow: 0 0 10px var(--amber-glow);
    filter: drop-shadow(0 0 8px var(--amber-glow));
  }
  100% {
    box-shadow: 0 0 25px var(--amber-glow);
    filter: drop-shadow(0 0 15px var(--amber-glow));
  }
}

@keyframes warm-logo-glow {
  0% {
    filter: drop-shadow(0 0 8px rgba(255, 184, 76, 0.4));
    stroke-width: 2;
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 184, 76, 0.6));
    stroke-width: 2.5;
  }
}

/* New Logo Animations */
@keyframes logo-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes logo-pulse {
  0% {
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(255, 184, 76, 0.3));
  }
  100% {
    stroke-width: 2.5;
    filter: drop-shadow(0 0 20px rgba(255, 184, 76, 0.5));
  }
}

@keyframes logo-node-pulse {
  0% {
    r: 2;
    opacity: 0.8;
  }
  100% {
    r: 3;
    opacity: 1;
  }
}

@keyframes logo-letter-glow {
  0% {
    stroke-width: 3;
    opacity: 0.8;
  }
  100% {
    stroke-width: 3.5;
    opacity: 1;
  }
}

@keyframes logo-connection-flow {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes warm-node-pulse {
  0% {
    r: 3;
    opacity: 0.7;
    filter: drop-shadow(0 0 8px var(--amber-glow));
  }
  100% {
    r: 5;
    opacity: 1;
    filter: drop-shadow(0 0 15px var(--amber-glow));
  }
}

@keyframes warm-connection-flow {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.4;
    filter: drop-shadow(0 0 5px var(--mint-glow));
  }
  100% {
    stroke-dashoffset: 20;
    opacity: 0.7;
    filter: drop-shadow(0 0 8px var(--mint-glow));
  }
}

@keyframes warm-particle-flow {
  0% {
    cx: 200;
    cy: 150;
    opacity: 0;
    filter: drop-shadow(0 0 6px var(--coral-glow));
  }
  25% {
    cx: 400;
    cy: 200;
    opacity: 0.8;
  }
  50% {
    cx: 800;
    cy: 250;
    opacity: 0.6;
  }
  75% {
    cx: 1200;
    cy: 120;
    opacity: 0.4;
  }
  100% {
    cx: 1600;
    cy: 180;
    opacity: 0;
  }
}

@keyframes warm-dash-flow {
  0% {
    stroke-dashoffset: 0;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: 20;
    opacity: 0.8;
  }
}

/* Performance optimizations */
.hero-background,
.contact-background,
.footer-background {
  will-change: transform;
}

.particle,
.node,
.connection {
  will-change: transform, opacity;
}

.tech-item,
.service-card,
.project-card {
  will-change: transform;
}
