/* ===== HEADER ===== */
.logo img {
  width: 50px;
  height: auto;
}

.header__about {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.header__top-about {
  margin-top: 20px;
}

.header__hero-about {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 80px;
  position: relative;
}

.header__hero-about h1 {
  font-size: 80px;
  font-weight: 500;
  line-height: 96px;
  margin-top: -100px;
  animation: hero-rise 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* Skip link для доступности */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #c2551e;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Блок команды в шапке */
.about__team-wrapper {
  position: absolute;
  bottom: 100px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px;
}

.about__team-wrapper::before {
  content: "";
  position: absolute;
  bottom: -50px;
  width: 100%;
  height: 1px;
  opacity: 0.2;
  background-color: var(--color-black);
  transform: scaleX(0);
  transform-origin: left;
  animation: line-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.about__team-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about__team-preview {
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background-color: var(--color-black);
  color: var(--color-white);
  max-width: fit-content;
}

.about__team-photo {
  display: flex;
  gap: 4px;
}

.about__team-photo img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.about__team-desc-right {
  line-height: 26px;
  opacity: 0.82;
  flex: 0 1 428px;
  margin: 0;
}

/* ===== АНИМАЦИЯ КОМАНДЫ (стопка фото) ===== */
.team__animation-wrapper {
  position: relative;
  height: 80vh;
  perspective: 1200px;
}

.team__animation-wrapper img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 420px;
  height: 500px;
  object-fit: cover;
  border-radius: 2px;
  transform-style: preserve-3d;
}

.team__animation-wrapper img:nth-child(1) {
  z-index: 10;
}
.team__animation-wrapper img:nth-child(2),
.team__animation-wrapper img:nth-child(3) {
  z-index: 5;
}
.team__animation-wrapper img:nth-child(4),
.team__animation-wrapper img:nth-child(5),
.team__animation-wrapper img:nth-child(6) {
  z-index: 2;
}

/* ===== КАРТА ===== */
.map {
  margin-top: 600px;
  margin-bottom: 150px;
}

.map__title {
  font-size: 60px;
  font-weight: 500;
  line-height: 73px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto 100px;
  animation: rise 1s both;
  animation-timeline: view();
  animation-range: cover 20% cover 50%;
}

.map__wrapper {
  position: relative;
  background-color: #fbf8f3;
  width: 90%;
  margin: 0 auto;
}

.map__wrapper img {
  width: 80%;
  display: block;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

/* Пины на карте */
.map__pin {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #c2551e;
  transform: translate(-50%, -50%);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: transform 0.2s ease;
}

.map__pin:focus-visible {
  outline: 2px solid #c2551e;
  outline-offset: 4px;
}

.map__pin:hover,
.map__pin:focus-visible {
  transform: translate(-50%, -50%) scale(1.3);
}

.map__pin::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(194, 85, 30, 0.45);
  animation: pin-pulse 2s ease-out infinite;
  pointer-events: none;
}

.map__pin-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: var(--color-black);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 2px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.map__pin:hover .map__pin-label,
.map__pin:focus-visible .map__pin-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== ЦИФРЫ И ФАКТЫ ===== */
.facts {
  padding: 120px 0;
}

.facts__slogan {
  max-width: 760px;
  margin: 0 auto 80px;
  text-align: center;
}

.facts__slogan-title {
  font-size: 64px;
  font-weight: 500;
  line-height: 76px;
  margin-bottom: 24px;
}

.facts__accent {
  color: #c2551e;
}

.facts__slogan-text {
  font-size: 18px;
  line-height: 30px;
  opacity: 0.82;
}

.facts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 60px 0;
  border-top: 1px solid rgba(27, 25, 23, 0.15);
  border-bottom: 1px solid rgba(27, 25, 23, 0.15);
  margin-bottom: 80px;
}

.facts__item {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.facts__item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 10%;
  height: 80%;
  width: 1px;
  background-color: rgba(27, 25, 23, 0.15);
}

.facts__number {
  font-size: 96px;
  font-weight: 500;
  line-height: 1;
  color: #c2551e;
  font-variant-numeric: tabular-nums;
}

.facts__plus {
  position: absolute;
  top: -10px;
  right: 25%;
  font-size: 40px;
  color: #c2551e;
  font-weight: 500;
}

.facts__label {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}

.facts__note {
  font-size: 14px;
  opacity: 0.6;
}

.facts__values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.facts__value {
  display: flex;
  gap: 24px;
  padding: 40px;
  border: 1px solid rgba(27, 25, 23, 0.15);
  border-radius: 2px;
  transition: border-color 0.3s ease;
}

.facts__value:hover {
  border-color: #c2551e;
}

.facts__value-icon {
  flex: 0 0 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(194, 85, 30, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.facts__value-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 12px;
}

.facts__value-desc {
  font-size: 16px;
  line-height: 26px;
  opacity: 0.82;
}

/* ===== АНИМАЦИИ ===== */
@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(80px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pin-pulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ===== АДАПТИВ ===== */

/* Большие десктопы и ноутбуки */
@media (max-width: 1200px) {
  .header__hero-about h1 {
    font-size: 64px;
    line-height: 76px;
  }

  .map__title {
    font-size: 48px;
    line-height: 58px;
  }

  /* Анимация команды: горизонтальный скролл */
  .team__animation-wrapper {
    height: auto;
    min-height: 380px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .team__animation-wrapper img {
    position: static;
    margin: 0;
    width: 260px;
    height: 340px;
    flex-shrink: 0;
    scroll-snap-align: center;
    transform: none !important;
  }

  .team__animation-wrapper img:nth-child(n) {
    z-index: auto;
  }

  .map {
    margin-top: 50px;
  }
}

/* Планшеты */
@media (max-width: 992px) {
  .header__hero-about {
    padding-bottom: 60px;
  }

  .header__hero-about h1 {
    font-size: 48px;
    line-height: 58px;
    margin-top: 200px;
    text-align: center;
  }

  .about__team-wrapper {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    padding: 0;
    margin-top: 40px;
  }

  .about__team-desc-right {
    flex: none;
    max-width: 500px;
  }

  .team__animation-wrapper {
    height: 60vh;
  }

  .team__animation-wrapper img {
    width: 320px;
    height: 400px;
  }

  .map {
    margin-top: 50px;
    margin-bottom: 50px;
  }

  .map__title {
    font-size: 40px;
    line-height: 48px;
    margin-bottom: 60px;
  }
}

/* Мобильные устройства */
@media (max-width: 768px) {
  .facts {
    padding: 80px 0;
  }

  .facts__slogan {
    margin-bottom: 50px;
  }

  .facts__slogan-title {
    font-size: 36px;
    line-height: 44px;
  }

  .facts__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0;
    margin-bottom: 50px;
  }

  .facts__item:not(:last-child)::after {
    right: 0;
    bottom: -20px;
    top: auto;
    width: 100%;
    height: 1px;
  }

  .facts__number {
    font-size: 64px;
  }

  .facts__values {
    grid-template-columns: 1fr;
  }

  .facts__value {
    flex-direction: column;
    gap: 16px;
    padding: 30px;
  }

  .header__hero-about {
    padding-bottom: 40px;
  }

  .header__hero-about h1 {
    font-size: 40px;
    line-height: 48px;
    margin-top: 100px;
  }

  .team__animation-wrapper {
    height: 350px;
  }

  .team__animation-wrapper img {
    width: 240px;
    height: 320px;
  }

  .map__wrapper {
    width: 100%;
  }

  .map__wrapper img {
    width: 100%;
  }

  .map__pin {
    width: 10px;
    height: 10px;
  }

  .map__pin::after {
    inset: -5px;
  }

  .map__title {
    font-size: 32px;
    line-height: 40px;
    margin-bottom: 40px;
  }
}

/* Маленькие мобильные */
@media (max-width: 576px) {
  .header__hero-about h1 {
    font-size: 32px;
    line-height: 40px;
    margin-top: 80px;
  }

  .about__team-photo img {
    width: 70px;
    height: 70px;
  }

  .about__team-preview {
    padding: 6px 10px;
    gap: 8px;
  }

  .map__title {
    font-size: 26px;
    line-height: 34px;
    margin-bottom: 30px;
  }

  .map__pin-label {
    font-size: 10px;
    padding: 4px 8px;
  }

  .facts__value-icon {
    background-color: transparent;
  }
}

/* Отключаем hover-эффекты на тач-устройствах */
@media (hover: none) {
  .map__pin:hover {
    transform: translate(-50%, -50%); /* убираем scale */
  }

  /* Тултип показывается ТОЛЬКО при тапе */
  .map__pin-label {
    opacity: 0; /* скрываем по умолчанию */
  }

  /* При тапе (focus) показываем тултип */
  .map__pin:focus .map__pin-label,
  .map__pin:active .map__pin-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    font-size: 10px;
  }
}

/* Поддержка prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
