/* ============================================================
   YTR Teknoloji — Animasyon Sistemi
   ============================================================ */

/* ---- Scroll Reveal Base ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }
.reveal--delay-5 { transition-delay: 0.5s; }
.reveal--delay-6 { transition-delay: 0.6s; }

.reveal--left {
  transform: translateX(-32px);
}
.reveal--left.visible { transform: translateX(0); }

.reveal--right {
  transform: translateX(32px);
}
.reveal--right.visible { transform: translateX(0); }

.reveal--scale {
  transform: scale(0.92);
}
.reveal--scale.visible { transform: scale(1); }

/* ---- Hero Text Reveal ---- */
.hero-line-wrap {
  overflow: hidden;
  display: block;
}

.hero-line {
  display: block;
  transform: translateY(110%);
  animation: lineReveal 1s cubic-bezier(0.4,0,0.2,1) forwards;
}

.hero-line--delay-1 { animation-delay: 0.1s; }
.hero-line--delay-2 { animation-delay: 0.25s; }
.hero-line--delay-3 { animation-delay: 0.4s; }
.hero-line--delay-4 { animation-delay: 0.55s; }
.hero-line--delay-5 { animation-delay: 0.7s; }

@keyframes lineReveal {
  to { transform: translateY(0); }
}

/* ---- Fade In ---- */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.fade-in--delay-1 { animation-delay: 0.15s; }
.fade-in--delay-2 { animation-delay: 0.3s; }
.fade-in--delay-3 { animation-delay: 0.45s; }
.fade-in--delay-4 { animation-delay: 0.6s; }
.fade-in--delay-5 { animation-delay: 0.75s; }
.fade-in--delay-6 { animation-delay: 0.9s; }

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ---- Float Animation ---- */
.float-anim {
  animation: floatUpDown 4s ease-in-out infinite;
}

.float-anim--delay-1 { animation-delay: 0.5s; }
.float-anim--delay-2 { animation-delay: 1s; }
.float-anim--delay-3 { animation-delay: 1.5s; }

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* ---- Shimmer ---- */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.04),
    transparent
  );
  animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
  to { left: 200%; }
}

/* ---- Glow Pulse ---- */
.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59,130,246,0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(59,130,246,0.4), 0 0 80px rgba(59,130,246,0.1);
  }
}

/* ---- Rotate ---- */
.rotate-slow {
  animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
  to { transform: rotate(360deg); }
}

/* ---- Gradient Shift ---- */
.gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

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

/* ---- Counter ---- */
.counter { transition: all 0.1s; }

/* ---- Card Tilt ---- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

/* ---- Image Hover Zoom ---- */
.img-zoom img {
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

.img-zoom:hover img {
  transform: scale(1.05);
}

/* ---- Stagger Children ---- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.visible > *:nth-child(1) { animation: staggerReveal 0.5s 0.0s ease forwards; }
.stagger-children.visible > *:nth-child(2) { animation: staggerReveal 0.5s 0.1s ease forwards; }
.stagger-children.visible > *:nth-child(3) { animation: staggerReveal 0.5s 0.2s ease forwards; }
.stagger-children.visible > *:nth-child(4) { animation: staggerReveal 0.5s 0.3s ease forwards; }
.stagger-children.visible > *:nth-child(5) { animation: staggerReveal 0.5s 0.4s ease forwards; }
.stagger-children.visible > *:nth-child(6) { animation: staggerReveal 0.5s 0.5s ease forwards; }
.stagger-children.visible > *:nth-child(7) { animation: staggerReveal 0.5s 0.6s ease forwards; }
.stagger-children.visible > *:nth-child(8) { animation: staggerReveal 0.5s 0.7s ease forwards; }
.stagger-children.visible > *:nth-child(9) { animation: staggerReveal 0.5s 0.8s ease forwards; }
.stagger-children.visible > *:nth-child(10) { animation: staggerReveal 0.5s 0.9s ease forwards; }
.stagger-children.visible > *:nth-child(n+11) { animation: staggerReveal 0.5s 1.0s ease forwards; }

@keyframes staggerReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Blob Background ---- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.3;
}

.blob--blue {
  background: radial-gradient(circle, rgba(59,130,246,0.4), transparent 70%);
}

.blob--purple {
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
}

.blob--cyan {
  background: radial-gradient(circle, rgba(6,182,212,0.3), transparent 70%);
}

/* ---- Typing Cursor ---- */
.typing-cursor::after {
  content: '|';
  animation: blink 1s infinite;
  color: var(--c-primary);
}

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

/* ---- Magnetic Button ---- */
.magnetic {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* ---- Section Transition Lines ---- */
.section-line {
  position: relative;
}

.section-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
  transition: width 1s ease;
}

.section-line.visible::before { width: 100%; }

/* ---- Mobile: reduced animations ---- */
@media (max-width: 768px) {
  .float-anim { animation: none; }
  .shimmer::after { animation: none; }
  .rotate-slow { animation: none; }

  .reveal {
    transition-duration: 0.5s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .fade-in,
  .hero-line,
  .float-anim,
  .shimmer::after,
  .rotate-slow,
  .gradient-shift,
  .glow-pulse {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
