:root {
  --color-bg: #efece6;
  --color-bg-alt: #e4dfd6;
  --color-text: #171416;
  --color-heading: #855f3a;
  --color-accent: #a07f63;
  --color-accent-soft: #ac9f8f;
  --color-muted: #b5b1ab;
  --color-card: #f8f4ee;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --header-height: 72px;
  --hero-image-position: center 10%;
  --hero-image-position-mobile: center 20%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Классы для анимации при скролле */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  transform: translateY(40px);
}

.animate-slide-up.animated {
  animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-down {
  transform: translateY(-40px);
}

.animate-slide-down.animated {
  animation: slideDown 0.8s ease-out forwards;
}

.animate-slide-left {
  transform: translateX(-40px);
}

.animate-slide-left.animated {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
  transform: translateX(40px);
}

.animate-slide-right.animated {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-scale {
  transform: scale(0.9);
}

.animate-scale.animated {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Задержки для последовательного появления */
.animate-delay-1 {
  transition-delay: 0.1s;
  animation-delay: 0.1s;
}

.animate-delay-2 {
  transition-delay: 0.2s;
  animation-delay: 0.2s;
}

.animate-delay-3 {
  transition-delay: 0.3s;
  animation-delay: 0.3s;
}

.animate-delay-4 {
  transition-delay: 0.4s;
  animation-delay: 0.4s;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

.container {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-header {
  text-align: left;
  margin-bottom: 40px;
  overflow: hidden;
}

/* Отключаем анимацию для секции контактов на главной */
#contacts .section-header,
#contacts .contacts-block {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.section-header h2 {
  margin: 8px 0 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--color-muted);
}

h1,
h2,
h3 {
  color: var(--color-heading);
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 3.3rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.9rem, 3.1vw, 2.4rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 0.75em;
}

.muted {
  color: var(--color-muted);
  font-size: 0.94rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background-color: var(--color-heading);
  color: #fdfbf8;
  box-shadow: 0 16px 35px rgba(91, 62, 33, 0.35);
}

.btn-primary:hover {
  background-color: #74502e;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 45px rgba(132, 94, 55, 0.5);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background-color: rgba(239, 236, 230, 0.7);
  color: var(--color-heading);
  border-color: rgba(91, 62, 33, 0.2);
}

.btn-ghost:hover {
  background-color: #f4efe7;
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost:active {
  transform: translateY(0) scale(0.98);
}

.grid {
  display: grid;
  gap: 28px;
}

.card {
  background-color: var(--color-card);
  padding: 22px 22px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-soft);
  background-color: #fdf9f3;
  border-color: rgba(172, 159, 143, 0.65);
}

.card-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 18px;
}

.card-body h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.card-text {
  font-size: 0.98rem;
  color: var(--color-text);
}

.meta-list {
  margin: 14px 0 0;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.meta-list dt {
  font-weight: 500;
  color: var(--color-heading);
}

.meta-list dd {
  margin: 0;
  color: var(--color-text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(23, 20, 22, 0.65),
    rgba(23, 20, 22, 0.35)
  );
  border-bottom: 1px solid rgba(23, 20, 22, 0.35);
  animation: slideDown 0.5s ease-out;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
}

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

.logo img {
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: rotate(5deg);
}

.logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdfbf8;
}

.main-nav {
  position: relative;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 22px;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
}

.nav-list a {
  position: relative;
  padding-block: 4px;
  color: #fdfbf8;
  transition: color 0.3s ease;
}

.nav-list a:hover {
  color: rgba(253, 251, 248, 0.9);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-heading));
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 0.18s ease-out;
}

.nav-list a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(23, 20, 22, 0.2);
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.nav-toggle:hover {
  background-color: rgba(23, 20, 22, 0.1);
  transform: scale(1.1);
}

.nav-toggle:active {
  transform: scale(0.95);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background-color: var(--color-heading);
  border-radius: 2px;
  margin-inline: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.main-nav.is-open .nav-toggle span:first-child {
  transform: rotate(45deg) translate(5px, 5px);
}

.main-nav.is-open .nav-toggle span:last-child {
  transform: rotate(-45deg) translate(5px, -5px);
}

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  margin-top: calc(-1 * var(--header-height));
  padding-top: calc(var(--header-height) + 36px);
  padding-bottom: 64px;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  padding: 0;
  z-index: 0;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 20%, rgba(239, 236, 230, 0.08), transparent 55%),
    linear-gradient(
      to bottom,
      rgba(23, 20, 22, 0.65),
      rgba(23, 20, 22, 0.35) 55%,
      rgba(23, 20, 22, 0.55)
    );
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  align-self: center;
  position: relative;
  z-index: 3;
}

.hero-content .eyebrow {
  animation: heroFadeIn 0.8s ease-out 0.2s both;
}

.hero-content h1 {
  animation: heroFadeIn 0.8s ease-out 0.4s both;
}

.hero-content .hero-subtitle {
  animation: heroFadeIn 0.8s ease-out 0.6s both;
}

.hero-content .hero-actions {
  animation: heroFadeIn 0.8s ease-out 0.8s both;
}

.hero-subtitle {
  font-size: 1.08rem;
  max-width: 32rem;
  color: rgba(253, 251, 248, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background-color: rgba(23, 20, 22, 0.35);
  border: 1px solid rgba(239, 236, 230, 0.22);
  color: rgba(253, 251, 248, 0.92);
  font-size: 0.9rem;
}
.hero .eyebrow {
  color: rgba(239, 236, 230, 0.7);
}

.hero h1 {
  color: #fdfbf8;
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.hero-actions .btn-ghost {
  background-color: rgba(239, 236, 230, 0.18);
  color: #fdfbf8;
  border-color: rgba(239, 236, 230, 0.35);
}

.hero-actions .btn-ghost:hover {
  background-color: rgba(239, 236, 230, 0.26);
}

.hero-media .slider {
  height: 100%;
  width: 100%;
  border-radius: 0;
}

.hero-media .slider::before {
  display: none;
}

.hero-media .slider-track {
  height: 100%;
  width: 100%;
}

.hero-media .slide {
  display: block !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media .slide.is-active {
  position: absolute;
}

.hero-media .slide img {
  filter: saturate(0.95) contrast(1.02);
  /* Не уменьшаем изображение при изменении ширины страницы:
     держим размер по высоте hero и при необходимости обрезаем по краям. */
  width: 100%;
  height: 100%;
  min-width: 100vw;
  min-height: 100%;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: var(--hero-image-position);
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), filter 1.2s ease;
  /* Начальное состояние - увеличенное */
  transform: scale(1.1);
  animation: heroImageZoomOut 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heroImageZoomOut {
  from {
    transform: scale(1.15);
    filter: saturate(1.1) contrast(1.1);
  }
  to {
    transform: scale(1);
    filter: saturate(0.95) contrast(1.02);
  }
}

.hero-note .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffcf8a, #c07739);
  box-shadow: 0 0 0 4px rgba(192, 119, 57, 0.25);
}

.advantages-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.advantage-card {
  background: radial-gradient(circle at 0 0, #f6eee2 0, #f8f4ee 35%, #f3ebdf 100%);
}

.services-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.service-card .card-media {
  margin: -6px -6px 18px;
}

/* Карусель для мобильных устройств */
.services-carousel {
  display: none;
  position: relative;
  overflow: hidden;
  margin-top: 0;
  padding: 0 50px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  margin-right: 20px;
}

.carousel-slide:last-child {
  margin-right: 0;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 20, 22, 0.6);
  color: #fdfbf8;
  cursor: pointer;
  z-index: 3;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-arrow--prev {
  left: 14px;
}

.carousel-arrow--next {
  right: 14px;
}

.carousel-arrow:hover {
  background: rgba(23, 20, 22, 0.9);
  transform: translateY(-50%) translateY(-2px) scale(1.1);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65);
}

.carousel-arrow:active {
  transform: translateY(-50%) translateY(0) scale(1.05);
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-muted);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-indicator:hover {
  transform: scale(1.3);
}

.carousel-indicator.is-active {
  background-color: var(--color-heading);
  transform: scale(1.4);
}

.horses-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.horse-card {
  display: flex;
  flex-direction: column;
}

.horse-media {
  margin-bottom: 16px;
}

.horse-meta {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
}

.contacts-block {
  margin-bottom: 22px;
}

.contacts-people {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.contact-phone {
  display: inline-block;
  font-weight: 500;
  margin-bottom: 4px;
}

.contact-phone {
  transition: color 0.3s ease, transform 0.2s ease;
}

.contact-phone:hover {
  color: var(--color-heading);
  transform: translateX(3px);
}

.messengers {
  margin: 0;
}

.messengers-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.messenger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-card);
  color: var(--color-heading);
  border: 1px solid rgba(133, 95, 58, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.messenger-btn:hover {
  transform: translateY(-3px) scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background-color: #fdf9f3;
  border-color: rgba(133, 95, 58, 0.35);
}

.messenger-btn:active {
  transform: translateY(-1px) scale(1.05) rotate(0deg);
}

.messenger-btn svg {
  width: 20px;
  height: 20px;
}


.contacts-form-wrapper {
  align-self: stretch;
}

.form-card {
  height: 100%;
}

.contact-form {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.form-field input,
.form-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(181, 177, 171, 0.8);
  background-color: #fbf8f2;
  font-size: 0.96rem;
  font-family: inherit;
  color: var(--color-text);
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  transform: translateY(-1px);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px rgba(160, 127, 99, 0.6),
    0 0 0 6px rgba(160, 127, 99, 0.18);
  background-color: #fff;
}

.form-note {
  font-size: 0.8rem;
  margin-top: 4px;
}

.form-success {
  min-height: 1em;
  font-size: 0.9rem;
  color: #2c7a4a;
}

.site-footer {
  border-top: 1px solid rgba(181, 177, 171, 0.55);
  background: radial-gradient(circle at top, #f5eee3, #e7e0d6);
  padding: 20px 0 24px;
  animation: fadeIn 0.8s ease-out;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.slider {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #d1c9bf;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background-color: var(--color-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.4);
  opacity: 0;
  transform: translateY(50px);
  will-change: opacity, transform;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-section.animated {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.split-section:last-child {
  margin-bottom: 0;
}

.split-section--reverse .split-media {
  order: 2;
}

.split-section--reverse .split-content {
  order: 1;
}

.split-media {
  min-height: 360px;
  display: flex;
  align-items: flex-start;
}

.split-media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  object-position: center;
  background: #d1c9bf;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-media:hover img {
  transform: scale(1.03);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.18);
}

.split-content h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.split-content p:last-child {
  margin-bottom: 0;
}

.collage {
  min-height: 360px;
  display: grid;
  gap: 10px;
  align-items: center;
}

.collage--2 {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(200px, auto);
  grid-template-areas:
    "a b";
}

.collage--3 {
  grid-template-columns: 1.1fr 0.9fr;
  grid-auto-rows: minmax(200px, auto);
  grid-template-areas:
    "a b"
    "a c";
  align-items: stretch;
}

.collage--3 .collage-item {
  height: 100%;
  object-fit: cover;
}

.collage--4 {
  grid-template-columns: 1.2fr 0.8fr;
  grid-auto-rows: minmax(200px, auto);
  grid-template-areas:
    "a b"
    "c d";
}

.collage-item {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  object-position: center;
  background: #d1c9bf;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    z-index 0s;
}

.collage-item:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.collage-item--a {
  grid-area: a;
}
.collage-item--b {
  grid-area: b;
}
.collage-item--c {
  grid-area: c;
}
.collage-item--d {
  grid-area: d;
}

.mobile-slider {
  display: none;
  min-height: 320px;
}

.slider-track {
  position: relative;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.95);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slide.is-active {
  position: relative;
  opacity: 1;
  transform: scale(1);
}

.slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.35),
    transparent 55%
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 20, 22, 0.6);
  color: #fdfbf8;
  cursor: pointer;
  z-index: 3;
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-arrow--prev {
  left: 14px;
}

.slider-arrow--next {
  right: 14px;
}

.slider-arrow:hover {
  background: rgba(23, 20, 22, 0.9);
  transform: translateY(-50%) translateY(-2px) scale(1.1);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.65);
}

.slider-arrow:active {
  transform: translateY(-50%) translateY(0) scale(1.05);
}

@media (hover: hover) {
  .slider-arrow {
    opacity: 0;
  }

  .slider:hover .slider-arrow {
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero {
    min-height: 100vh;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 28px);
  }

  .hero-media {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .hero-content {
    margin-top: 0;
  }

  .contacts-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .hero {
    /* На мобильных 100vh иногда ведёт себя нестабильно (адресная строка/панели браузера).
       100dvh = динамическая высота вьюпорта, помогает убрать «серое поле» ниже hero. */
    height: 100dvh;
  }

  .header-inner {
    height: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(133, 95, 58, 0.95);
    border: 2px solid rgba(253, 251, 248, 0.3);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    min-width: 180px;
    transform-origin: top right;
    transform: scale(0.8) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
      transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-list a {
    color: #fdfbf8;
  }

  .main-nav.is-open .nav-list {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
  }

  .nav-list li {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .main-nav.is-open .nav-list li {
    opacity: 1;
    transform: translateX(0);
  }

  .main-nav.is-open .nav-list li:nth-child(1) {
    transition-delay: 0.05s;
  }

  .main-nav.is-open .nav-list li:nth-child(2) {
    transition-delay: 0.1s;
  }

  .main-nav.is-open .nav-list li:nth-child(3) {
    transition-delay: 0.15s;
  }

  .main-nav.is-open .nav-list li:nth-child(4) {
    transition-delay: 0.2s;
  }

  .main-nav.is-open .nav-list li:nth-child(5) {
    transition-delay: 0.25s;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .card {
    padding: 18px 18px 20px;
  }

  /* На мобильных показываем карусель вместо сетки */
  .services-grid {
    display: none;
  }

  .services-carousel {
    display: block;
  }

  .split-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  /* На мобильных всегда показываем изображения выше текста
     даже для блоков с модификатором .split-section--reverse */
  .split-section .split-media {
    order: 1;
  }

  .split-section .split-content {
    order: 2;
  }

  .split-media {
    min-height: auto;
  }

  .collage {
    display: none;
  }

  .mobile-slider {
    display: block;
  }

  .mobile-slider.slider {
    border-radius: var(--radius-md);
  }

  /* Чуть смещаем фокус главной картинки на мобильных,
     чтобы важная часть кадра оставалась в видимой зоне.
     Картинка может обрезаться по краям, но не растягивается. */
  .hero-media .slide img {
    /* На мобильных используем специальную позицию для обрезки.
       Измените --hero-image-position-mobile в :root для настройки. */
    object-position: var(--hero-image-position-mobile);
  }

  .horses-list {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    width: calc(100% - 28px);
  }

  .logo-text {
    display: none;
  }

  .hero-note {
    border-radius: 14px;
    align-items: flex-start;
  }

  .gallery-container {
    gap: 16px;
  }

  .gallery-item {
    border-radius: var(--radius-sm);
  }
}

/* Стили для галереи */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-card);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.animated {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Модальное окно для просмотра фотографий */
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.gallery-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.gallery-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.gallery-modal-close:active {
  transform: scale(0.95);
}

.gallery-modal-prev,
.gallery-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.gallery-modal-prev {
  left: 20px;
}

.gallery-modal-next {
  right: 20px;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.gallery-modal-prev:active,
.gallery-modal-next:active {
  transform: translateY(-50%) scale(0.95);
}

/* Адаптивные стили для галереи */
@media (max-width: 768px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .gallery-modal-prev,
  .gallery-modal-next {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .gallery-modal-prev {
    left: 10px;
  }

  .gallery-modal-next {
    right: 10px;
  }

  .gallery-modal-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
}


