@font-face {
  font-family: 'TildaSans';
  src: url('assets/fonts/TildaSans-VF.woff2') format('woff2-variations'),
       url('assets/fonts/TildaSans-VF.woff2') format('woff2');
  font-weight: 250 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #ec343a;
  --red-dark: #c92228;
  --blue: #628598;
  --ink: #1a1a1a;
  --ink-soft: #2b2828;
  --gray-bg: #f0f0f0;
  --radius: 30px;
  --font: 'TildaSans', Arial, sans-serif;
  --header-h: 80px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.container_narrow { max-width: 860px; }

.section-title {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 60px;
}
.section-title_light { color: #fff; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 73px;
  padding: 0 40px;
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font: 400 20px/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease-in-out, transform .2s ease-in-out;
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn_sm { min-height: 56px; padding: 0 32px; font-size: 16px; font-weight: 700; }

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.header__inner {
  max-width: 1200px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.header__logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.header__nav { display: flex; gap: 30px; margin-left: auto; }
.header__nav a,
.header__phone {
  font-size: 18px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color .3s ease-in-out;
}
.header__nav a:hover,
.header__phone:hover { color: var(--red); }
.header__phone { font-weight: 700; }
.header__phone_mobile { display: none; }

.burger {
  display: none;
  position: relative;
  width: 28px;
  height: 20px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: #000;
  transition: .25s ease-in-out;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 8px; }
.burger span:nth-child(3) { top: 16px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* Первый экран */
.hero { padding: 20px 20px 0; }
.hero__card {
  position: relative;
  max-width: 1760px;
  min-height: 820px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: linear-gradient(0turn, rgb(150, 189, 210) 0%, rgb(212, 212, 212) 49%, rgba(98, 133, 152, .87) 100%);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.hero__text {
  padding: 60px 40px 60px 100px;
  max-width: 640px;
  justify-self: end;
}
.hero__title {
  font-size: 100px;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 40px;
}
.hero__name,
.hero__surname { display: block; }
.hero__surname { padding-left: .1em; }
.hero__facts {
  display: grid;
  gap: 8px;
  max-width: 480px;
  margin-bottom: 60px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}
.hero__media {
  position: static; /* осьминог позиционируется от карточки, чтобы не вылезать за её край */
  align-self: end;
  justify-self: start;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.hero__photo {
  position: relative;
  z-index: 1;
  width: 438px;
  max-height: 760px;
  object-fit: contain;
  object-position: bottom;
  border-radius: var(--radius) var(--radius) 0 0;
}
.hero__octopus {
  position: absolute;
  top: 5%;
  right: 0;
  width: clamp(420px, 42vw, 700px);
  max-width: none;
  opacity: .08;
  pointer-events: none;
}

.hero_repeat { padding-bottom: 20px; }

.contacts__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 32px;
  margin-top: 40px;
}
.contacts__phone { font-size: 26px; font-weight: 700; color: var(--ink); text-decoration: none; }
.contacts__phone:hover { color: var(--red); }

/* Карточки */
.courses {
  background: var(--red);
  padding: 120px 0;
  margin-top: 90px;
}
.courses .section-title { font-size: clamp(34px, 6vw, 66px); margin-bottom: 90px; }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}
.card__img { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__img img { transform: scale(1.04); }
.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 30px;
}
.card__title { font-size: clamp(26px, 3vw, 42px); font-weight: 700; line-height: 1.15; }
.card__title a { text-decoration: none; }
.card__descr { font-size: 18px; line-height: 1.5; color: #555; }
.card .btn { margin-top: auto; }

/* Цифры */
.stats { padding: 80px 0 60px; }
.stats__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 40px;
}
/* Подсетка: цифры, подписи и описания встают в общие строки и выравниваются по горизонтали */
.stat {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
}
.stat__num {
  font-variant-numeric: tabular-nums;
  font-size: clamp(56px, 7vw, 90px);
  font-weight: 900;
  line-height: 1;
  color: var(--blue);
}
.stat__label {
  margin: 10px 0 20px;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1;
  color: var(--blue);
}
.stat__descr { font-size: 16px; line-height: 1.55; color: #333; }

/* Форумы и клиенты */
.gray { background: var(--gray-bg); padding: 90px 0; }
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 105px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform .15s linear, box-shadow .15s linear;
}
/* Как на Tilda: плитка увеличивается с тенью; крайние колонки растут внутрь, а не за экран */
@media (hover: hover) and (min-width: 981px) {
  .gallery img:hover {
    position: relative;
    z-index: 2;
    transform: scale(1.04);
    box-shadow: 0 2px 20px 2px rgba(0, 0, 0, .45);
  }
  .gallery img:nth-child(4n+1) { transform-origin: left; }
  .gallery img:nth-child(4n+4) { transform-origin: right; }
  .gallery img:nth-child(4n+1):hover,
  .gallery img:nth-child(4n+4):hover { transform: scale(1.02); }
}

.logos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 30px 20px;
  align-items: center;
}
.logos img {
  width: 100%;
  max-width: 180px;
  margin: 0 auto;
}

/* Появление при прокрутке (как на Tilda: только на экранах от 980px, элементы группы — по очереди) */
@media (min-width: 980px) {
  .js-animate [data-animate] {
    opacity: 0;
    transition: opacity .5s cubic-bezier(.19, 1, .22, 1), transform .5s cubic-bezier(.19, 1, .22, 1);
  }
  .js-animate [data-animate="zoomin"] { transform: scale(.9); }
  .js-animate [data-animate].is-visible { opacity: 1; transform: none; }
}

/* Подход */
.approach { padding: 90px 0; text-align: center; }
.approach__lead {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.23;
  color: var(--blue);
  margin-bottom: 30px;
}
.approach__text { font-size: 20px; line-height: 1.55; }
.approach__text_big { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; color: var(--blue); }

.what { background: #fff; padding: 30px 0 15px; }
.what .section-title { color: var(--ink); font-size: 26px; font-weight: 400; margin-bottom: 85px; }
.what__list { display: grid; grid-template-columns: 1fr; gap: 54px; max-width: 760px; margin: 0 auto; counter-reset: what; list-style: none; }
.what__list li { counter-increment: what; position: relative; display: flex; align-items: center; min-height: 66px; padding-left: 105px; color: var(--ink); font-size: 22px; font-weight: 700; line-height: 1.45; }
.what__list li::before { content: counter(what); position: absolute; top: 50%; left: 0; transform: translateY(-50%); display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 22px; font-weight: 600; }
.what + .approach .approach__text_big { color: var(--ink); font-weight: 400; }
@media(max-width:639px) { .what .section-title { font-size: 24px; margin-bottom: 40px; } .what__list { gap: 32px; } .what__list li { padding-left: 72px; font-size: 18px; min-height: 52px; } .what__list li::before { width: 50px; height: 50px; font-size: 18px; } }
/* Отзывы */
.reviews { background: #c7c7c7; padding: 90px 0; }
.slider { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 70px; }
.slider__viewport { overflow: hidden; border-radius: var(--radius); }
.slider__track { display: flex; transition: transform .5s ease; }
.slider__track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1680 / 813;
  object-fit: cover;
  cursor: zoom-in;
}
.slider__arrow {
  position: absolute;
  top: calc((100% - 40px) / 2); /* центр картинки без учёта точек снизу */
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transition: background-color .2s ease, color .2s ease;
}
.slider__arrow:hover { background: var(--red); color: #fff; }
.slider__arrow_prev { left: 10px; }
.slider__arrow_next { right: 10px; }
.slider__dots { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.slider__dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
}
.slider__dots button[aria-current="true"] { background: var(--red); }

/* Видео */
.events { padding: 105px 0; }
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__play {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, .15);
  cursor: pointer;
  transition: background-color .2s ease;
}
.video__play:hover { background: rgba(0, 0, 0, .3); }
.video__play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 40px no-repeat;
  transition: transform .2s ease;
}
.video__play:hover::after { transform: scale(1.08); }
.video figcaption { margin-top: 20px; font-size: 20px; font-weight: 600; line-height: 1.35; }

/* Контакты */
.contacts { padding: 60px 0; text-align: center; color: var(--blue); }
.contacts__title { font-size: clamp(28px, 4vw, 42px); font-weight: 700; line-height: 1.23; }
.contacts__descr { margin-top: 20px; font-size: 24px; }
.socials { display: flex; justify-content: center; gap: 12px; margin-top: 60px; }
.socials a { display: block; width: 64px; height: 64px; transition: transform .2s ease; }
.socials a:hover { transform: translateY(-3px); }
.socials svg { width: 100%; height: 100%; fill: var(--red); }
.socials a.socials__max {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red);
}
.socials__max img { width: 50%; height: 50%; }

/* Подвал */
.footer { background: #8a8a8a; color: #fff; padding: 30px 0; font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 30px; }
.footer__copy { margin-right: 120px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 30px; }
.footer a { color: #fff; text-decoration: none; opacity: .9; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer__up { margin-left: auto; }

/* Лайтбокс */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, .9);
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}
.lightbox__arrow:hover { background: var(--red); }

/* Общая геометрия стрелок: SVG-шеврон строго по центру круга */
.slider__arrow,
.lightbox__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.slider__arrow svg,
.lightbox__arrow svg {
  width: 45%;
  height: 45%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox__arrow_prev { left: 20px; }
.lightbox__arrow_next { right: 20px; }
.lightbox__counter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  color: rgba(255, 255, 255, .8);
  font-size: 16px;
}
.lightbox_single .lightbox__arrow,
.lightbox_single .lightbox__counter { display: none; }
.lightbox { padding: 50px 90px; }
@media (max-width: 639px) {
  .lightbox { padding: 50px 10px; }
  .lightbox__arrow { width: 44px; height: 44px; font-size: 30px; background: rgba(0, 0, 0, .45); }
  .lightbox__arrow_prev { left: 8px; }
  .lightbox__arrow_next { right: 8px; }
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
}

/* Cookie */
.cookie {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: 400px;
  padding: 24px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  font-size: 16px;
  line-height: 1.45;
}
.cookie[hidden] { display: none; }
.cookie p { margin-bottom: 16px; }

/* Адаптив */
@media (max-width: 1199px) {
  .hero__text { padding-left: 60px; }
  .hero__title { font-size: 88px; }
  .cards { gap: 24px; }
  .logos { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 980px) {
  :root { --header-h: 64px; }
  .burger { display: block; }
  .header__phone { display: none; }
  .header__nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 24px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, .06);
    box-shadow: 0 16px 30px rgba(0, 0, 0, .12);
    /* Раскрывается вниз из-под шапки, не наезжая на логотип */
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    visibility: hidden;
    transition: clip-path .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, visibility 0s linear .35s;
  }
  .header__nav.is-open {
    clip-path: inset(0 0 -40px 0); /* отрицательный низ оставляет видимой тень */
    opacity: 1;
    visibility: visible;
    transition: clip-path .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, visibility 0s;
  }
  .header__nav a {
    color: var(--ink-soft);
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    font-size: 18px;
  }
  .header__phone_mobile {
    display: block;
    margin-top: 8px;
    border-bottom: 0 !important;
    color: var(--red) !important;
    font-weight: 700;
  }

  .hero__card { grid-template-columns: 1fr; min-height: 0; text-align: center; }
  .hero__text { justify-self: center; padding: 60px 30px 40px; }
  .hero__facts { margin-left: auto; margin-right: auto; }
  .hero__media { justify-self: center; height: auto; }
  .hero__photo { width: 400px; height: auto; max-height: none; aspect-ratio: 448 / 900; }
  /* Осьминог привязан к верху фото, поэтому никогда не заходит под текст и кнопку */
  .hero__media { position: relative; }
  .hero__text { padding-bottom: 80px; }
  /* left 52.9%: голова на фото смещена вправо от центра кадра, осьминог выравнивается по ней */
  .hero__octopus { top: -70px; bottom: auto; left: 52.9%; right: auto; transform: translateX(-50%); width: 120%; max-width: none; }

  .cards { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .stats__list { grid-template-columns: repeat(2, 1fr); }
  .stat__descr { padding-bottom: 40px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .what__list { grid-template-columns: 1fr; gap: 30px; }
  .videos { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .section-title { margin-bottom: 40px; }
  .hero { padding: 10px 10px 0; }
  .hero__title { font-size: 64px; }
  .hero__facts { font-size: 16px; margin-bottom: 40px; }
  .hero__photo { width: 280px; }
  .courses { padding: 80px 0; margin-top: 60px; }
  .courses .section-title { margin-bottom: 50px; }
  .card__body { padding: 24px; }
  .stats__list { grid-template-columns: 1fr; text-align: center; }
  .gray, .approach, .what, .reviews, .events { padding: 60px 0; }
  .gallery { margin-bottom: 60px; }
  .logos { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
  .slider { padding: 0 10px; }
  /* Стрелки уходят под отзыв, по бокам от точек, чтобы не закрывать картинку */
  .slider {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px 12px;
    padding: 0 16px;
  }
  .slider__viewport { grid-column: 1 / -1; grid-row: 1; border-radius: 16px; }
  .slider__arrow { position: static; transform: none; grid-row: 2; width: 44px; height: 44px; }
  .slider__arrow_prev { grid-column: 1; }
  .slider__arrow_next { grid-column: 3; }
  .slider__dots { grid-column: 2; grid-row: 2; margin-top: 0; }
  .what__list li { font-size: 19px; padding-top: 64px; }
  .footer__up { margin-left: 0; }
  .footer__copy { margin-right: 0; width: 100%; }
  .cookie { left: 10px; right: 10px; bottom: 10px; max-width: none; }
}

@media (max-width: 479px) {
  .hero__title { font-size: 52px; }
  .btn { min-height: 64px; padding: 0 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js-animate [data-animate] { opacity: 1 !important; transform: none !important; }
}
