:root {
  --maincolor: #4B6DFE;
  --maindark: #272168;
  --window-width: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: #fff; /* фон под canvas, можно поменять на градиент или темный цвет */
  overflow-x: hidden;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* --- Overlay для десктопа --- */
#desktop-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-height));
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 2500; /* ниже шапки (3000), выше остальных элементов */
}

#desktop-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: var(--header-height);

  
  background-image: url("../fon1.png");
  background-size: cover;       /* растягиваем по ширине/высоте */
  background-position: center;  /* центрируем */
  background-repeat: no-repeat; /* не повторяем */
}

.hero .btn-primary{
  padding: 25px 50px;
  font-size: 2.4rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--window-width);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  text-align: left;
}

.hero-main-title {
  font-family: "Montserrat";
  font-size: clamp(2.8rem, 7vw, 3.5rem);
  font-weight: 800;
  line-height: 1.5;
  word-break: auto-phrase;
  hyphens: auto;
  max-width: 65%;
  margin: 0px 0px 100px;
  color: white;
}

/* --- Glass block with blur effect --- */
.hero-glass-block {
  position: relative;
  max-width: 600px;
  padding: 0;
  border-radius: 16px;
  z-index: 1;
}

.hero-glass-block p {
  font-family: "Montserrat";
  font-size: 1.5rem;
  line-height: 1.5;
  margin-top: 0;
  margin-bottom: 30px;
  color: white;
}

/* Цифры */
.numbers {
  padding: 20px 0;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.numbers-content {
  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */
}

.numbers .hero-main-title {
  margin: 50px;
}

.numbers-text {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(2.5rem, 0.9vw + 0.8rem, 3.5rem);
  line-height: 1.6;
  color: black;
  font-weight: bold;
  margin: 30px 0;
  max-width: var(--window-width);
}

.numbers-grid {
  display: flex;
  justify-content: space-between;
  gap: 100px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.number-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 26%;
  transition: transform 0.4s ease;
}

.number-item:hover {
  transform: translateY(-8px);
}

.number-item span {
  font-size: clamp(2rem, 7vw, 7rem);
  font-weight: 400;
  color: black;
  display: block;
  line-height: 1;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

/* знак "+" сразу отображается */
.number-item span[data-plus="true"]::after {
  content: "+";
  font-size: clamp(2rem, 7vw, 7rem);
  font-weight: 400;
  margin-left: 6px;
  color: black;
  transform: translateY(-10%);
}

.number-item.visible span {
  opacity: 1;
  transform: translateY(0);
}

.number-item p {
  font-family: "Montserrat";
  font-size: clamp(1rem, 1.5vw + 0.2rem, 2.0rem);
  line-height: 1.5;
  color: #444;
  margin: 0;
  text-transform: lowercase;
  letter-spacing: 0.5px;
}

.numbers-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  gap: 50px;
}

.numbers-button-wrapper .btn-primary {
  font-size: 2.5rem;
  white-space: nowrap;
  text-align: center;
  display: inline-block;
  transition: transform 0.3s ease;
}

/* Анимация при наведении */
.numbers-button-wrapper .btn-primary:hover {
  animation: tiltScale 0.6s ease-in-out;
}

/* Ключевые кадры: наклон влево → вправо → центр + масштаб */
@keyframes tiltScale {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-3deg) scale(1.05);
  }
  50% {
    transform: rotate(3deg) scale(1.05);
  }
  75% {
    transform: rotate(-2deg) scale(1.03);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

.numbers-button-wrapper .line {
  flex-grow: 1;
  height: 1px;
  background-color: var(--maincolor);
}

/* Стек */
.stek {
  padding: 20px 0px;
  text-align: left;
  position: relative;
  overflow: hidden;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */
}

.stek-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 30px;
  padding: 0 20px;
}

.stek-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  width: 100%;
}

.stek-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border: 2px solid var(--maincolor);
  border-radius: 12px;
  padding: 10px 0px;
  text-align: center;
  transition: all 0.4s ease;
  transform-origin: center;
  height: 100%; /* гарантирует равную высоту */
}

.stek-item:hover {
  border-style: dashed;
  transform: rotate(3deg) translateY(-5px);
}

.stek-img-wrapper {
  height: 120px; /* фиксированная высота блока под изображение */
  display: flex;
  align-items: center;
  justify-content: center;
}

.stek-item img {
  max-width: 100px;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.stek-item p {
  margin: 0;
  font-size: 1rem;
  font-family: "Montserrat";
  color: black;
  height: 15%;
}

/* Сферы */
.it-spheres {
  padding: 10px 0;
  text-align: left;
  position: relative;
  overflow: hidden;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;
}

.spheres-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 0 20px;
}

.spheres-buttons .btn-primary {
  font-size: 2.8rem;
  user-select: none;
  transition: transform 0.4s ease;
  pointer-events: auto;
  cursor: default;
  display: inline-block;
}

/* Анимация при наведении */
.spheres-buttons .btn-primary:hover {
  animation: tiltScale 0.6s ease-in-out;
}

/* Ключевые кадры — наклон влево, вправо, масштаб */
@keyframes tiltScale {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-3deg) scale(1.05);
  }
  50% {
    transform: rotate(3deg) scale(1.05);
  }
  75% {
    transform: rotate(-2deg) scale(1.03);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* --- Вакансии --- */
.vacancies {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  
  background-image: url("../fon2.png");
  background-size: cover;       /* растягиваем по ширине/высоте */
  background-position: center;  /* центрируем */
  background-repeat: no-repeat; /* не повторяем */
}

.vacancies-content {
  padding: 100px 0px;
  text-align: left;
  position: relative;
  overflow: hidden;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */
}

.vacancies .numbers-text {
  color: white;
  padding: 0;
  max-width: 50%;
  font-size: 3.2rem;
  margin-top: 100px;
}

.vacancies .btn-primary {
  padding: 25px 50px;
  font-size: 2.4rem;
}

/* Кнопка с иконкой */
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 50px; /* расстояние между текстом и иконкой */
  margin-top: 20px; /* опускаем кнопку ниже */
}

.btn-with-icon .btn-icon {
  width: 100px;
  height: 40px;
  object-fit: contain;
}

/* tabs section */
.tabs-section {
  margin: 0 auto;
  font-family: Arial, sans-serif;
  background-color: var(--maindark);
}

.tabs-section .numbers-text {
  color: white;
  padding: 0;
  margin: 30px 0px;
}

.tabs-container {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-bottom-width: 2px;
  border-bottom-color: var(--maincolor);
  border-bottom-style: solid;
  
  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */
}

.tabs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 колонки */
  grid-template-rows: repeat(2, auto);   /* 2 строки */
  gap: 20px;
  width: 100%;
  margin-bottom: 30px;
}

.tab-link {
  display: flex;
  padding: 25px 50px;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat";
  background-color: var(--maincolor);
  color: #fff;
  border-color: var(--maincolor) !important;
  border: solid;
  text-decoration: none;
  font-weight: bold;
  border-radius: 50px;
  font-size: 2.6rem;
  height: 220px; /* фиксированная высота для равенства */
  text-align: center; /* если текст переносится — центрируем */
  box-sizing: border-box; /* чтобы padding не выходил за пределы */
}

.tab-link:hover {
  background-color: #fff;
  color: var(--maincolor);
}

/* bloks section */
.grid-section {
  background-color: var(--maindark);
  padding: 40px 20px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */
}

.grid-item {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 200px;
}

.image-wrapper {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 100px;
  height: 100px;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.text-wrapper {
  font-family: "Montserrat";
  font-size: 1.5rem;
  margin-top: 90px;
  color: black;
}

/* case section */
.cases-section {
  background-color: var(--maincolor);
  padding: 40px 20px;
  color: white;
}

.cases-content{  
    text-align: left;
    position: relative;
    overflow: hidden;
  
    max-width: var(--window-width);       /* ограничение ширины */
    margin: 0 auto;          /* центрирование по горизонтали */
    width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
    box-sizing: border-box;  /* чтобы padding не выходил за пределы */  
}

.cases-section .numbers-text {
  color: white;
}

.cases-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 100%;
  margin: 0 auto;
}

.arrow {
  background-color: var(--maincolor);
  color: var(--maindark);
  border: none;
  font-size: 4rem;
  cursor: pointer;
  z-index: 2;
}

.cases-carousel {
  display: flex;
  gap: 20px;
  overflow: hidden;
  width: 100%;
}

.case-card {
  background-color: var(--maindark);
  color: white;
  border-radius: 16px;
  padding: 20px;
  flex: 0 0 calc(100% / 3 - 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  transition: transform 0.3s ease;
}

.case-card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 16px;
  border-radius: 8px;
}

.case-card h3 {
  font-weight: bold;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.0rem, 0.9vw + 0.8rem, 1.2rem);
  color: white;
  font-weight: 800;
  padding: 0;
  margin-bottom: 10px;
}

.case-card p {
  font-family: "Montserrat";
  font-size: 1.0rem;
  margin-top: 10px;
  color: white;
}

.carousel-dots {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dots .dot {
  width: 12px;
  height: 12px;
  background-color: white;
  opacity: 0.4;
  border-radius: 50%;
  transition: opacity 0.3s ease;
}

.carousel-dots .dot.active {
  opacity: 1;
}

/* reviews section */
.reviews-section {
  background-color: white;
  padding: 40px 20px;
}

.reviews-content{  
  text-align: left;
  position: relative;
  overflow: hidden;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */  
}

.reviews-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.reviews-section .arrow {
  background-color: white;
}

.reviews-carousel {
  display: flex;
  gap: 20px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.review-card {
  flex: 0 0 100%;
  background-color: #ffffff;
  border: 4px solid var(--maincolor);
  border-radius: 16px;
  padding: 30px;
  box-sizing: border-box;
  font-family: "Montserrat";
  font-size: 1.5rem;
  line-height: 1.6;
  color: black;
  transition: transform 0.3s ease;
}

.review-card h3 {
  font-weight: bold;
  font-family: "Montserrat";
  font-size: clamp(1.0rem, 0.9vw + 0.8rem, 1.5rem);
  color: black;
  font-weight: 800;
  padding: 0;
  margin-bottom: 10px;
}

.review-card p {
  font-style: italic;
}

.review-author {
  text-align: right;
  font-style: normal;
  font-weight: 600;
  margin-top: 10px;
  font-size: 1.5rem;
}


.review-card .word {
  opacity: 0;
  transform: translateY(10px);
  display: inline-block;
  animation: wordFadeIn 0.5s forwards;
  white-space: pre; /* сохраняет пробелы */
}


@keyframes wordFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reviews-section .carousel-dots {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.reviews-section .carousel-dots .dot {
  width: 12px;
  height: 12px;
  background-color: var(--maindark);
  opacity: 0.3;
  border-radius: 50%;
  transition: opacity 0.3s ease;
}

.reviews-section .carousel-dots .dot.active {
  opacity: 1;
}

/* contact section */
.contact-section {
  background-color: var(--maindark);
  padding: 60px 20px;
  color: white;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 40px;

  max-width: var(--window-width);       /* ограничение ширины */
  margin: 0 auto;          /* центрирование по горизонтали */
  width: 100%;             /* чтобы занимать всю доступную ширину до 1200px */
  box-sizing: border-box;  /* чтобы padding не выходил за пределы */  
}

.contact-left {
  flex: 2;
  display: flex;
  align-items: center;
}

.contact-left h2 {
  font-size: 3rem;
  line-height: 1.4;
  color: white;
  font-family: "Montserrat", sans-serif;
  margin: 0;
}

.contact-right {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* Кнопки контактов */
.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch; /* ← растягивает кнопки на одинаковую ширину */
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 20px;

  padding: 5px 5px;
  font-family: "Montserrat";
  background-color: var(--maincolor);
  color: #fff;
  border-color: var(--maincolor) !important;
  border: solid;
  text-decoration: none;
  border-radius: 15px;
  font-size: 1.2rem;

  width: 100%;           /* ← занимает всю ширину родителя */
  max-width: 400px;      /* ← ограничение ширины, если нужно */
  box-sizing: border-box;
  justify-content: flex-start; /* ← выравнивание содержимого по левому краю */
}

.contact-buttons .contact-btn:hover {
  background-color: #fff;
  color: var(--maincolor);
}

.contact-buttons .btn-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* --- Adaptive styles --- */
@media (max-width: 1024px) {
  .hero {
    height: 50vh;
  }

  .hero-content {
    justify-content: flex-start; /* убираем центрирование по вертикали */
    height: auto; /* больше не растягиваем на всю высоту */
    padding: 10px;
  }

  .hero-main-title {
    font-size: clamp(
      1.0rem,
      8vw,
      1.5rem
    ); /* больше на мобилке, но уменьшается для маленьких экранов */
    margin-bottom: 35px; /* больше отступа до блока */
    font-weight: 600;
  }

  .hero .btn-primary {
    padding: 15px 25px;
    font-size: 1.2rem;
  }

  .btn-primary {
    text-align: center;
  }

  .numbers-button-wrapper {
    gap: 10px;
  }

  .numbers-button-wrapper .btn-primary {
    font-size: 1.2rem;
  }

  .hero-main-title {
    font-weight: 600;
    margin-bottom: 20px;
  }

  #hero-canvas {
    top: 72px;
    pointer-events: none;
  }

  .numbers {
    padding: 0px 10px;
    height: auto;
  }

  .numbers-grid {
    flex-direction: column;
    gap: 50px;
    padding: 0 30px;
  }

  .number-item{
    max-width: 100%;
  }

  .number-item span {
    font-size: clamp(4rem, 12vw, 5rem);
  }

  .number-item p {
    font-size: clamp(1rem, 4vw, 1.6rem);
  }

  .numbers-text {
    font-size: clamp(1.5rem, 3.5vw, 1.8rem);
    margin: 20px 0px 20px;
  }

  .numbers .hero-main-title {
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 20px;
  }
  
  .stek {
    padding: 10px;
  }

  .stek-grid {
    gap: 20px;
  }

  .stek-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .stek-item {
    padding: 5px;
  }

  .stek-item img {
    max-height: 100px;
  }

  .stek-item p {
    font-size: 0.9rem;
  }

  .steks-content .numbers-text {
    font-size: 1.5rem;
    margin-left: 0;
  }

  .stek-grid {
    padding: 10px;
  }

  .it-spheres {
    padding: 10px;
  }

  .spheres-buttons {
    gap: 5px;
    margin: 0;
    padding: 0;
  }

  .spheres-buttons .btn-primary {
    font-size: 0.9rem;
    padding: 10px 5px;
  }

  .vacancies-content {
    padding: 10px;
  }

  .vacancies .numbers-text {
    max-width: 100%;
    font-size: 1.8rem;
  }

  .hero-glass-block p {
    font-size: 1.0rem;
    max-width: 70%;
  }

  .vacancies .hero-content{
    padding-top: 0;
  }

  .vacancies .btn-primary {
    padding: 15px 10px;
    font-size: 1.2rem;
    margin: 0px 0px 30px;
  }

  .btn-with-icon {
    gap: 5px;
  }

  .btn-with-icon .btn-icon {
    width: 30px;
    max-height: 20px;
  }

  .tabs-container {
    padding: 10px;
  }

  .tab-link {
    padding: 10px;
    font-size: 1.2rem;
    max-height: 100px;
    border-radius: 15px;
  }

  .tabs-grid {
    grid-template-columns: repeat(1, 1fr); /* 2 кнопки в строке */
  }

  .tabs-section .numbers-text {
    margin: 0;
  }

  .grid-section {
    padding: 40px 10px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .grid-item {
    min-height: auto;
    padding: 16px;
  }

  .image-wrapper {
    width: 75px;
    height: 75px;
    top: 12px;
    right: 12px;
  }

  .text-wrapper {
    margin-top: 70px;
    font-size: 1.2rem;
  }

  .text-wrapper p {
    margin: 0;
  }

  .cases-section {
    padding: 10px;
  }

  .case-card {
    flex: 0 0 100%;
  }

  .arrow {
    display: none;
  }

  .numbers-text {
    font-size: 24px;
  }

  .case-card h3 {
    margin-top: 0;
    font-size: clamp(1.5rem, 3.5vw, 1.8rem);
  }

  .case-card p {
    margin-top: 0;
    font-size: clamp(1.0rem, 3.5vw, 1.2rem);
    margin-bottom: 10px;
  }

  .reviews-section {
    padding: 10px;
  }

  .reviews-section .arrow {
    display: none;
  }

  .review-card {
    font-size: 1.2rem;
    padding: 10px;
  }

  .review-author {
    font-size: 1.2rem;
  }

  .contact-section {
    padding: 10px;
  }

  .contact-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .contact-left {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .contact-left h2 {
    font-size: 1.5rem;
  }

  .contact-right {
    width: 100%;
    justify-content: center;
  }

}
