@font-face {
  font-family: "GTA Russian";
  src: url("./src/fonts/GTA%20Russian.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple: #615083;
  --orange: #ef4c2f;
  /* Боковой отступ: 300px на 1920, плавно уменьшается до 20px,
     контент при этом не шире 1320px */
  --side-offset: clamp(20px, calc((100vw - 1320px) / 2), 300px);
  --section-gap: 160px;
  --text-gradient: linear-gradient(82.26deg, #626d99 -13.64%, #974395 186.66%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--purple);
}

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

/* Первый экран */
.hero {
  position: relative;
  min-height: 720px;
  min-height: max(720px, 100svh);

  background-image: url("./src/content/backgrounds/main.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;

  overflow: hidden;
}

/* Навигация */
.header {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 36px);

  width: calc(100% - var(--side-offset) * 2);
  min-height: 101px;
  margin: 48px auto 0;
  padding: 12px 14px;

  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 12px;
}

.header__logo {
  display: flex;
  flex-shrink: 0;
}

.header__logo img {
  display: block;
  width: 58px;
  height: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.5vw, 24px);
}

.header__nav a {
  font-family: "GTA Russian", "Montserrat", sans-serif;
  /* 32px на 1920, плавно меньше на узких десктопах */
  font-size: clamp(20px, 1.67vw, 32px);
  font-weight: 400;
  text-transform: uppercase;
  white-space: nowrap;

  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  transition: opacity 0.2s;
}

.header__nav a:hover {
  opacity: 0.65;
}

.header__return {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
  width: 221px;
  height: 60px;
  margin-left: auto;
  padding: 16px 28px;

  background: #fff;
  border: 1.25px solid #d1cbd9;
  border-radius: 12px;

  color: #503965;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;

  transition: background 0.2s;
}

.header__return:hover {
  background: #f6f0fa;
}

/* Бургер — виден только на планшетах и телефонах */
.header__burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;

  width: 48px;
  height: 48px;

  background: #fff;
  border: 1.25px solid #d1cbd9;
  border-radius: 12px;
  cursor: pointer;
}

.header__burger span {
  display: block;
  width: 20px;
  height: 2px;

  background: #543e76;
  border-radius: 2px;
  transition:
    transform 0.2s,
    opacity 0.2s;
}

/* Бургер превращается в крестик */
.header.is-open .header__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header.is-open .header__burger span:nth-child(2) {
  opacity: 0;
}

.header.is-open .header__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Основной контейнер */
.hero__container {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: flex-start;

  width: calc(100% - var(--side-offset) * 2);
  margin: 0 auto;
  /* 106px на 1920, плавно меньше на узких экранах */
  padding-top: clamp(56px, 5.52vw, 106px);
}

.hero__content {
  width: 100%;
  max-width: 600px;
}

/* Текст с фирменным градиентом */
.hero__subtitle,
.hero__description {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Заголовок */
.hero__title {
  line-height: 0;
}

.hero__title img {
  display: block;
  width: clamp(320px, 23.75vw, 456px);
  max-width: 100%;
  height: auto;
}

.hero__subtitle {
  width: fit-content;
  margin-top: 21px;

  font-family: "Inter", sans-serif;
  font-size: clamp(26px, 1.67vw, 32px);
  font-weight: 700;
  line-height: 0.97;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Описание */
.hero__description {
  margin-top: clamp(32px, 3.75vw, 72px);

  max-width: 560px;

  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.02em;
}

/* Кнопка и сроки */
.hero__actions {
  margin-top: clamp(40px, 5.05vw, 97px);
}

.hero__button,
.how__card-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 309px;
  height: 80px;

  border-radius: 16px;
  border: 2.25px solid #fff;

  background: linear-gradient(26.16deg, #e84427 29.99%, #fff09d 277.97%);

  box-shadow: 0 3px 10px rgba(126, 67, 66, 0.18);

  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;

  transition: filter 0.2s;
}

.hero__button:hover,
.how__card-button:hover {
  filter: brightness(1.05);
}

.hero__date {
  margin-top: 16px;

  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 31px;
  letter-spacing: -0.02em;
}

/* Секция «О розыгрыше» */
/* Один градиент на все секции после первого экрана, включая футер */
.page-bg {
  background: linear-gradient(
    0deg,
    #ffffff -18.86%,
    #fff1f1 4.76%,
    #efe1f7 101.98%
  );
}

.about {
  padding: var(--section-gap) 0 0;
}

.about__container {
  width: calc(100% - var(--side-offset) * 2);
  margin: 0 auto;
}

.about__row {
  display: flex;
  align-items: center;
  gap: 60px;
}

.about__row--second {
  margin-top: var(--section-gap);
}

.about__image {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  height: auto;
}

.about__image--courier {
  width: 763px;
  /* drop-shadow повторяет форму картинки (скошенные панели с прозрачностью),
     box-shadow нарисовал бы прямоугольник */
  filter: drop-shadow(0 4px 11.8px #e4c5d0);
}

.about__image--keys {
  width: 854px;
  border: 1px solid #fff;
  border-radius: 16px;
  box-shadow: 0 4px 11.8px 0 #e4c5d0;
}

.about__text,
.about__info {
  flex: 1;
}

.about__text,
.about__accent,
.about__note {
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;

  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.about__text {
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.about__accent {
  margin-top: 16px;

  font-size: 32px;
  font-weight: 700;
  line-height: 32px;
}

.about__note {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

/* Сплошной цвет вместо градиента */
.about__accent,
.about__note {
  background: none;
  -webkit-text-fill-color: #543e76;
  color: #543e76;
}

/* Как участвовать */
.how {
  width: calc(100% - var(--side-offset) * 2);
  margin: var(--section-gap) auto 0;
  /* Небольшой воздух над заголовком при переходе по якорю #prizes */
  scroll-margin-top: 32px;
}

.how__title {
  line-height: 0;
}

.how__title img {
  display: block;
  width: 454px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.how__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;

  margin-top: 40px;
  list-style: none;
}

.how__card {
  display: flex;
  flex-direction: column;

  min-height: 480px;
  padding: 58px 19px 11px;

  background: url("./src/content/backgrounds/card.png") center / cover
    no-repeat;
  border-radius: 11px;
  overflow: hidden;
}

.how__card-image {
  display: block;
  flex-shrink: 0;
  width: 210px;
  height: 210px;
  margin: 0 auto;
  object-fit: contain;
}

.how__card-text {
  margin-top: 20px;

  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.02em;
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
  color: #543e76;
}

.how__card-number {
  font-weight: 700;
}

/* Кнопка карточки: 284px при карточке 308px — выходит за padding 19px на 7px с каждой стороны */
.how__card-button {
  flex-shrink: 0;
  width: calc(100% + 14px);
  margin: auto -7px 0;
}

.how__card-text {
  margin-bottom: 53px;
}

/* Этапы розыгрыша */
.timeline {
  width: calc(100% - var(--side-offset) * 2);
  margin: var(--section-gap) auto 0;

  list-style: none;
  text-align: center;
  color: #543e76;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;
}

/* Стрелка вниз между этапами */
.timeline__item + .timeline__item::before {
  content: "";
  display: block;

  width: 23px;
  height: 26px;
  margin: 16px auto;

  background: url("./src/content/content/arrow_down.png") center / contain
    no-repeat;
}

.timeline__date {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
}

.timeline__text {
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
}

/* Финальный блок */
.finale {
  width: calc(100% - var(--side-offset) * 2);
  margin: var(--section-gap) auto 0;
}

.about__image--boat {
  width: 892px;
}

.about__text + .about__text {
  margin-top: 32px;
}

/* Футер с вопросами */
.footer {
  padding: var(--section-gap) 0 120px;

  /* Градиент приходит от .page-bg, поверх — только картинка, прижатая к низу.
     Размер зависит только от ширины экрана, футер не ниже картинки */
  min-height: calc(min(100vw, 1660px) * 822 / 1914);
  background: url("./src/content/backgrounds/footer.png") center bottom /
    min(100%, 1660px) auto no-repeat;
}

.footer__container {
  width: calc(100% - var(--side-offset) * 2);
  margin: 0 auto;
}

.footer__title {
  line-height: 0;
}

.footer__title img {
  display: block;
  width: 398px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 24px;

  /* Запас под один раскрытый ответ (открыт может быть только один —
     name="faq" у details): высота списка не меняется, футер и картинка
     не двигаются. 4 × 80 + 3 × 24 = 392px закрытый список + 170px запас */
  min-height: 562px;

  margin-top: 40px;
  list-style: none;
}

.faq__item {
  padding: 8px 8px 8px 16px;

  /* В закрытом состоянии рамка есть, но белая — сливается с блоком,
     поэтому при раскрытии размер не меняется */
  border: 1.75px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(#fff, #fff) border-box;
  box-shadow: 0 6px 20px rgba(84, 62, 118, 0.14);
}

/* Раскрытый блок выделяется градиентной рамкой.
   border-image не дружит с border-radius, поэтому рамку рисует
   второй слой фона, видимый только в зоне border */
.faq__item[open] {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.5) -13.88%,
        rgba(115, 125, 174, 0.5) 100%
      )
      border-box;
}

/* Градиент на отдельном span, чтобы не обрезать белый фон блока */
.faq__question {
  font-family: "Inter", sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.02em;

  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Строка вопроса: текст слева, кнопка 64×64 справа (8 + 64 + 8 = 80px высота блока) */
.faq__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  cursor: pointer;
  list-style: none;
}

.faq__summary::-webkit-details-marker {
  display: none;
}

/* Кнопка раскрытия с плюсом, который превращается в минус */
.faq__toggle {
  position: relative;
  flex-shrink: 0;

  width: 64px;
  height: 64px;

  border: 1.75px solid transparent;
  border-radius: 11px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.5) -13.88%,
        rgba(115, 125, 174, 0.5) 100%
      )
      border-box;

  transition: filter 0.2s;
}

/* Стрелка drop_down, при открытии разворачивается вверх */
.faq__toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;

  width: 21px;
  height: 15px;

  background: url("./src/content/content/drop_down.png") center / contain
    no-repeat;
  transform: translate(-50%, -50%);
  transition: transform 0.25s;
}

.faq__item[open] .faq__toggle::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

.faq__summary:hover .faq__toggle {
  filter: brightness(0.97);
}

.faq__summary:focus-visible {
  outline: 2px solid #974395;
  outline-offset: 4px;
  border-radius: 8px;
}

.faq__answer {
  padding: 8px 80px 12px 0;

  color: #543e76;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.02em;
}

/* Список условий в ответе: пункты с тире, как в тексте */
.faq__answer ul {
  list-style: none;
}

.faq__answer li::before {
  content: "- ";
}

/* Документы и реквизиты */
.footer__info {
  margin-top: 48px;

  color: #594865;
  font-family: "Roboto", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.footer__links a:hover {
  text-decoration: underline;
}

.footer__requisites {
  max-width: 820px;
  margin: 12px auto 0;
  line-height: 1.4;
}

/* Первый экран: узкие десктопы — сдвигаем фон, чтобы персонажи не залезали под текст */
@media (max-width: 1200px) {
  .hero {
    background-position: 30% top;
  }

  .hero__content {
    max-width: 520px;
  }
}

/* Первый экран: планшеты и телефоны — текст сверху, персонажи под ним.
   Картинка масштабируется по ширине и прижата к низу, а под неё
   оставлено место через padding-bottom (высота картинки = ширина × 957/1920) */
@media (max-width: 900px) {
  .hero {
    --hero-bg-scale: 1.7;
    --hero-bg-height: calc(100vw * var(--hero-bg-scale) * 957 / 1920);

    min-height: 0;
    padding-bottom: calc(var(--hero-bg-height) - 40px);

    background:
      /* мягкий переход от заливки к верхнему краю картинки — без шва */
      linear-gradient(180deg, #eedff0 0%, rgba(238, 223, 240, 0) 25%) center
        bottom / 100% var(--hero-bg-height) no-repeat,
      url("./src/content/backgrounds/main.png") 72% bottom /
        calc(var(--hero-bg-scale) * 100%) auto no-repeat,
      linear-gradient(180deg, #f6eaf4 0%, #eedff0 100%);
  }

  .hero__content {
    max-width: 560px;
  }

  .hero__title img {
    width: 380px;
  }

  .hero__subtitle {
    font-size: 28px;
  }

  .hero__description {
    margin-top: 32px;
    font-size: 17px;
    line-height: 26px;
  }

  .hero__actions {
    margin-top: 40px;
  }
}

@media (max-width: 640px) {
  .hero {
    --hero-bg-scale: 2.1;
    background-position:
      center bottom,
      74% bottom,
      0 0;
  }

  .hero__container {
    padding-top: 40px;
  }

  .hero__content {
    max-width: none;
  }

  .hero__title img {
    width: 300px;
  }

  .hero__subtitle {
    margin-top: 16px;
    font-size: 24px;
  }

  .hero__description {
    margin-top: 24px;
    font-size: 16px;
    line-height: 24px;
  }

  .hero__actions {
    margin-top: 32px;
  }

  .hero__button {
    width: 100%;
    max-width: 309px;
    height: 64px;
    border-radius: 14px;
    font-size: 20px;
  }

  .hero__date {
    margin-top: 12px;
    line-height: 18px;
  }
}

/* Планшеты: меню прячется в бургер */
@media (max-width: 900px) {
  .header {
    min-height: 72px;
    padding: 12px;
    gap: 12px;
  }

  .header__burger {
    display: flex;
  }

  /* Меню — выпадающая панель под шапкой */
  .header__nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;

    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;

    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(84, 62, 118, 0.18);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s,
      transform 0.2s,
      visibility 0.2s;
  }

  .header.is-open .header__nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .header__nav a {
    padding: 12px 8px;
    font-size: 26px;
  }

  .header__return {
    width: auto;
    height: 48px;
    padding: 0 20px;
    font-size: 16px;
  }

  .how__cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Телефоны */
@media (max-width: 640px) {
  .header {
    min-height: 64px;
    margin-top: 16px;
    padding: 10px;
    gap: 8px;
  }

  .header__logo img {
    width: 44px;
  }

  .header__return {
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
  }

  .header__burger {
    width: 44px;
    height: 44px;
  }

  :root {
    --section-gap: 56px;
  }

  .about__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .about__row--second {
    flex-direction: column-reverse;
  }

  .about__image--courier,
  .about__image--keys,
  .about__image--boat {
    width: 100%;
  }

  .about__text {
    font-size: 16px;
    line-height: 22px;
  }

  .about__accent {
    margin-top: 12px;
    font-size: 22px;
    line-height: 26px;
  }

  .about__note {
    font-size: 13px;
    line-height: 18px;
  }

  .how__cards {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }

  /* Компактная карточка: иконка слева, текст справа, кнопка снизу */
  .how__card {
    display: grid;
    grid-template-columns: 88px 1fr;
    grid-template-areas:
      "icon text"
      "button button";
    align-items: center;
    gap: 20px 16px;

    min-height: 0;
    padding: 20px 16px 16px;
  }

  .how__card-image {
    grid-area: icon;
    width: 88px;
    height: 88px;
    margin: 0;
  }

  .how__card-text {
    grid-area: text;
    margin: 0;
    font-size: 16px;
    line-height: 22px;
  }

  .how__card-button {
    grid-area: button;
    width: 100%;
    height: 56px;
    margin: 0;
    border-radius: 14px;
    font-size: 18px;
  }

  .faq__question {
    font-size: 18px;
    line-height: 22px;
  }

  .faq__toggle {
    width: 48px;
    height: 48px;
  }

  /* Без запаса под раскрытый ответ — на телефоне он давал большую дыру */
  .faq {
    min-height: 0;
  }

  .footer__info {
    margin-top: 64px;
  }

  .faq__answer {
    padding-right: 0;
    font-size: 16px;
    line-height: 22px;
  }
}

/* Совсем узкие телефоны */
@media (max-width: 360px) {
  .header__return {
    padding: 0 10px;
    font-size: 12px;
  }
}
