/*
  Главная. Почти всё позиционируется абсолютно по координатам из Figma
  (утилиты .abs / .sized / .deco и шапка — в style.css).
  Секции внутри .card на десктопе — display: contents, поэтому координаты детей считаются от карточки.
  Ниже 1024px (телефоны и планшеты) всё переключается в обычный поток.
*/

/* ---------- Первый экран ---------- */
.hero {
  position: relative;
  --ox: calc(50% - 960 * var(--u));
  /* обложка всегда на весь экран, независимо от общего масштаба --scale */
  --hu: calc(min(100vw, 2560px) / 1920);
  /* +76 — на столько карточка «Обо мне» наезжает на обложку: без прокрутки её не видно */
  height: max(calc(100svh + 76 * var(--u)), calc(1080 * var(--u)));
  overflow: hidden;
  background: #1a1420 url('/img/hero.webp') no-repeat;
  /* кадрирование как в макете: картинка увеличена ~на 25% и сдвинута */
  /* не меньше ширины и высоты экрана, чтобы не было пустых полос (картинка 16:9) */
  background-size: max(calc(2400.6 * var(--hu)), 100%, calc((100svh + 76 * var(--u) + 176.8 * var(--hu)) * 16 / 9)) auto;
  /* то же кадрирование, что в макете, но по центру экрана любой ширины */
  background-position: calc(50% - 23.8 * var(--hu)) calc(-176.8 * var(--hu));
}

/* заголовок и стрелка держатся у низа обложки, как в макете (только ПК) */
@media (min-width: 1024px) {
  .hero h1,
  .hero .scroll-down {
    top: calc(100% - (1080 - var(--y)) * var(--u));
  }
}


.hero h1 {
  width: calc(804 * var(--u));
  font-size: calc(64 * var(--u));
  font-weight: 500;
  text-transform: uppercase;
}

.scroll-down img {
  rotate: 180deg;
}

.scroll-down {
  animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
  50% { transform: translateY(calc(8 * var(--u))); }
}

/* ---------- Карточка «Обо мне» ---------- */
.card {
  position: relative;
  --ox: 0px;
  z-index: 1;
  width: calc(1533 * var(--u));
  height: calc(2697 * var(--u));
  margin: calc(-76 * var(--u)) auto 0;
  border-radius: calc(54 * var(--u)) calc(54 * var(--u)) 0 0;
  overflow: hidden;
  background: linear-gradient(#621c1c, #4e1212) top / 100% calc(3675 * var(--u)) no-repeat, #4e1212;
}

.card > section,
.profile-meta,
.soft-icons,
.contact-links {
  display: contents;
}

.card-title {
  position: absolute;
  top: calc(136 * var(--u));
  left: 0;
  right: 0;
  text-align: center;
  font-size: calc(64 * var(--u));
  font-weight: 600;
}

/* Профиль */
.plate {
  background: var(--cream);
  border-radius: calc(51 * var(--u));
}

.photo {
  border-radius: 50%;
  overflow: hidden;
}

.photo img {
  position: absolute;
  left: calc(-29.856 * var(--u));
  top: calc(-8.611 * var(--u));
  width: calc(352.608 * var(--u));
  height: calc(284.253 * var(--u));
  max-width: none;
}

.profile-meta span {
  color: var(--wine);
  font-size: calc(36 * var(--u));
  font-weight: 400;
  white-space: nowrap;
}

.profile-meta .visually-hidden {
  position: absolute;
}

.profile-desc {
  color: var(--wine);
  font-size: calc(32 * var(--u));
  font-weight: 300;
  white-space: nowrap;
}

/* Про рисование */
.about-text p {
  font-size: calc(32 * var(--u));
  font-weight: 300;
  text-align: center;
}

.about-text b {
  font-weight: 500;
}

/* Софт */
.soft h3 {
  margin: 0;
  font-size: calc(48 * var(--u));
  font-weight: 600;
  white-space: nowrap;
}

.soft-icons {
  margin: 0;
  padding: 0;
  list-style: none;
}

.soft-icons img {
  object-fit: cover;
}

.soft-icons .rounded {
  border-radius: calc(20 * var(--u));
}

/* Маскот */
.mascot p {
  z-index: 1;
  color: var(--wine);
  font-size: calc(32 * var(--u));
  font-weight: 300;
  text-align: right;
}

/* Контакты */
.contacts h2 {
  font-size: calc(48 * var(--u));
  font-weight: 600;
  text-align: center;
}

/* ---------- Мобильная раскладка ---------- */
@media (max-width: 1023px) {
  .hero {
    height: min(100svh, 720px);
    background-size: cover;
    background-position: 58% center;
  }

  .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgb(0 0 0 / 0.45), transparent 30%, transparent 55%, rgb(0 0 0 / 0.55));
  }


  .hero h1 {
    z-index: 1;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 98px;
    width: auto;
    font-size: clamp(28px, 8.5vw, 40px);
  }

  .scroll-down {
    z-index: 1;
    left: calc(50% - 12px);
    top: auto;
    bottom: 52px;
    width: 24px;
    height: 18px;
  }

  .card {
    width: auto;
    height: auto;
    margin: -24px 8px 0;
    padding: 40px 16px 56px;
    border-radius: 28px 28px 0 0;
    background-size: 100% 2400px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .card > section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .card .abs {
    position: static;
    left: auto;
    top: auto;
  }

  .card .sized {
    width: auto;
    height: auto;
  }

  .deco,
  .frame,
  .bubble,
  .outline,
  .ring,
  .plate,
  .profile-meta .sep {
    display: none;
  }

  .card-title {
    position: static;
    font-size: 30px;
  }

  /* Профиль: аватар сверху, кремовая плашка с текстом */
  .profile {
    padding: 0 20px 24px;
    margin-top: 80px;
    border-radius: 28px;
    background: var(--cream);
  }

  .card .photo {
    position: relative;
    width: 160px;
    height: 160px;
    margin-top: -80px;
    border: 6px solid var(--cream);
    background: var(--cream);
  }

  .photo img {
    left: -18px;
    top: -5px;
    width: 211px;
    height: 170px;
  }

  .profile-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
  }

  .profile-meta span {
    font-size: 20px;
  }

  .profile-meta > span:not(:first-child) {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--wine);
    line-height: 1.1;
  }

  .profile-desc {
    margin-top: 10px;
    font-size: 15px;
    white-space: normal;
  }

  /* Текстовые рамки */
  .about-text,
  .soft {
    padding: 22px 18px;
    border: 4px solid var(--cream);
    border-radius: 28px;
  }

  .about-text p {
    font-size: 15px;
    line-height: 1.45;
  }

  .soft h3 {
    font-size: 22px;
  }

  .soft-icons {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
  }

  .card .soft-icons li {
    width: 56px;
    height: 56px;
  }

  .soft-icons .rounded {
    border-radius: 10px;
  }

  /* Маскот */
  .card .goat {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 0 5px var(--cream)) drop-shadow(0 0 0 var(--cream));
  }

  .mascot p {
    order: 2;
    margin-top: -16px;
    padding: 26px 20px 20px;
    border-radius: 24px;
    background: var(--cream);
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
  }

  /* Контакты */
  .contacts h2 {
    font-size: 22px;
  }

  .contact-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-top: 20px;
  }

  .contact-links a:nth-child(1) { width: 52px; height: 39px; }
  .contact-links a:nth-child(2) { width: 48px; height: 48px; }
  .contact-links a:nth-child(3) { width: 54px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-down {
    animation: none;
  }
}
