/* ===== Главная — появление текста при загрузке ===== */
@keyframes hero-title-in {
  from {
    opacity: 0;
    transform: translateY(52px);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes hero-text-in {
  from {
    opacity: 0;
    transform: translateY(34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-image-in {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes hero-actions-in {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-hero-intro] .hero-intro__title {
  animation: hero-title-in 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

[data-hero-intro] .hero-intro__text {
  animation: hero-text-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

[data-hero-intro] .hero-intro__actions {
  animation: hero-actions-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.52s both;
}

[data-hero-intro] .hero-intro__image {
  animation: hero-image-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

html.hero-first-visit [data-hero-intro] .hero-intro__title {
  animation-duration: 1.35s;
  animation-delay: 0.12s;
}

html.hero-first-visit [data-hero-intro] .hero-intro__text {
  animation-duration: 1.05s;
  animation-delay: 0.42s;
}

/* ===== Каталог — появление при загрузке ===== */
@keyframes catalog-header-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes catalog-tabs-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes catalog-card-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-page .catalog-title__text {
  animation: catalog-header-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.catalog-page .catalog-tabs {
  animation: catalog-tabs-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.catalog-page .catalog-card:nth-child(1) {
  animation: catalog-card-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.26s both;
}

.catalog-page .catalog-card:nth-child(2) {
  animation: catalog-card-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.catalog-page .catalog-card:nth-child(3) {
  animation: catalog-card-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.catalog-page .catalog-card:nth-child(4) {
  animation: catalog-card-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.62s both;
}

/* Переход между вкладками каталога */
.catalog-page--leave .catalog-title,
.catalog-page--leave .catalog-section {
  opacity: 0;
  transform: translateY(18px) scale(0.99);
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.catalog-page--tab-enter .catalog-title__text,
.catalog-page--tab-enter .catalog-tabs,
.catalog-page--tab-enter .catalog-card {
  animation: none !important;
  opacity: 0;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-title__text {
  animation: catalog-header-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both !important;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-tabs {
  animation: catalog-tabs-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both !important;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-card:nth-child(1) {
  animation: catalog-card-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both !important;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-card:nth-child(2) {
  animation: catalog-card-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both !important;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-card:nth-child(3) {
  animation: catalog-card-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.48s both !important;
}

.catalog-page--tab-enter.catalog-page--tab-enter-active .catalog-card:nth-child(4) {
  animation: catalog-card-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both !important;
}

/* Внутренние страницы — шапка */
.page-hero__content,
.about-page-hero .amenities-text,
.amenities-title .amenities-text,
.contacts-hero__text,
.cases-hero__text {
  animation: page-fade-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.catalog-tab {
  transition:
    background-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

.catalog-tab--active {
  box-shadow: 0 12px 28px rgba(10, 36, 99, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  [data-hero-intro] .hero-intro__title,
  [data-hero-intro] .hero-intro__text,
  [data-hero-intro] .hero-intro__actions,
  [data-hero-intro] .hero-intro__image,
  .catalog-page .catalog-title__text,
  .catalog-page .catalog-tabs,
  .catalog-page .catalog-card,
  .page-hero__content,
  .about-page-hero .amenities-text,
  .amenities-title .amenities-text,
  .contacts-hero__text,
  .cases-hero__text {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .catalog-page--leave .catalog-title,
  .catalog-page--leave .catalog-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
