/*  STICKY НАВИГАЦИЯ */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(196, 190, 163, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  animation: slideDown 0.5s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
}

header nav a {
  position: relative;
  transition: all 0.3s ease;
}

header nav a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #72876a;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

header nav a:hover::after,
header nav a.active::after {
  width: 80%;
}

header nav a:hover {
  color: #72876a;
  transform: translateY(-2px);
}

/* КАРТОЧКИ УСЛУГ С АНИМАЦИЕЙ */

.services {
  position: relative;
}

.card {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Анимация появления */
.card.animate-in {
  animation: fadeInUp 0.8s ease forwards;
}

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

/* Задержки для каскадного эффекта */
.card:nth-child(1).animate-in {
  animation-delay: 0.4s;
}
.card:nth-child(2).animate-in {
  animation-delay: 0.6s;
}
.card:nth-child(3).animate-in {
  animation-delay: 0.8s;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 60px rgba(114, 135, 106, 0.3);
}

.card img {
  transition: transform 0.6s ease;
}

.card:hover img {
  transform: scale(1.1);
}

.card h3 {
  position: relative;
  display: inline-block;
}

/* Анимированная линия под заголовком */
.card h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(to right, #72876a, #c4bea3);
  transition: width 0.4s ease;
}

.card:hover h3::after {
  width: 100%;
}

/* Анимация кнопок  */
.button-service {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.button-service::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.button-service:hover::before {
  width: 300px;
  height: 300px;
}

.button-service:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(114, 135, 106, 0.4);
}

/* ОТЗЫВЫ С АНИМАЦИЕЙ */

.press-row {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.5s ease;
}

/* Анимация появления */
.press-row.animate-in {
  animation: testimonialFadeIn 0.8s ease forwards;
}

@keyframes testimonialFadeIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Чередование направления */
.press-row:nth-child(even) {
  transform: translateX(50px);
}

.press-row:nth-child(1).animate-in {
  animation-delay: 0.1s;
}
.press-row:nth-child(2).animate-in {
  animation-delay: 0.2s;
}
.press-row:nth-child(3).animate-in {
  animation-delay: 0.3s;
}
.press-row:nth-child(4).animate-in {
  animation-delay: 0.4s;
}

.press-row:hover {
  transform: translateY(-5px) scale(1.01);
}

.press-text {
  position: relative;
  transition: all 0.3s ease;
}

.press-row:hover .press-text {
  box-shadow: 0 20px 60px rgba(114, 135, 106, 0.2);
}

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

.press-author {
  opacity: 0;
  transform: translateY(10px);
}

.press-row.animate-in .press-author {
  animation: slideUp 0.5s ease forwards 0.6s;
}

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

@keyframes zoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.press-item img:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(114, 135, 106, 0.3);
}

/* КАРТОЧКИ ЗАМЕТОК */

.about-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease;
}

.about-item.animate-in {
  animation: fadeInUp 0.8s ease forwards;
}

.about-item:nth-child(1).animate-in {
  animation-delay: 0.1s;
}
.about-item:nth-child(2).animate-in {
  animation-delay: 0.2s;
}
.about-item:nth-child(3).animate-in {
  animation-delay: 0.3s;
}

.about-item:hover {
  transform: translateY(-10px);
}

.about-item-img {
  transition: transform 0.6s ease;
}

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

/* HERO СЕКЦИЯ */

.hero {
  animation: heroFadeIn 0.5s ease;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blobFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 0.3;
    transform: translateY(0) scale(1);
  }
}
.hero--service::before {
  animation: blobFadeIn 0.6s ease-out backwards 0.7s;
}
.hero-text span {
  opacity: 0;
  animation: textReveal 1.5s ease forwards;
}
.hero h1 {
  opacity: 0;
  animation: textReveal 1.7s ease forwards;
}

.hero-text span:nth-child(1) {
  animation-delay: 0.2s;
}
.hero-text span:nth-child(2) {
  animation-delay: 0.5s;
}

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

.hero-cta-link {
  transition: all 0.3s ease;
}

.hero-cta-link:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(114, 135, 106, 0.4);
}

.hero-cta-round {
  opacity: 0;
  animation: buttonReveal 2s ease forwards;
}

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

/* CONTACT СЕКЦИЯ */

.contact {
  animation: fadeInUp 0.8s ease;
}

.contact-telegram img {
  transition: all 0.3s ease;
}

.contact-telegram:hover img {
  transform: scale(1.1) rotate(10deg);
}

/* CERTIFICATES CAROUSEL */

.splide {
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.3s;
}

.splide__slide {
  transition: transform 0.3s ease;
}

.splide__slide:hover {
  transform: scale(1.05);
}

.splide__arrow {
  transition: all 0.3s ease;
}

.splide__arrow:hover {
  transform: translateY(-50%) scale(1.1);
}

/* FOOTER */

.main-footer {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards 0.5s;
}

.footer-section a {
  transition: all 0.3s ease;
}

.footer-section a:hover {
  transform: translateX(5px);
}

/* ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ */

/* Скрываем элементы до анимации */
.card:not(.animate-in),
.press-row:not(.animate-in),
.about-item:not(.animate-in) {
  visibility: hidden;
}

.card.animate-in,
.press-row.animate-in,
.about-item.animate-in {
  visibility: visible;
}

/* Плавное появление секций */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth scroll */

/* Accessibility - уменьшенные анимации */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
