/* ===================== */
/* === СЕКЦИИ === */
/* ===================== */
/* Общие секции */
.section {
  padding: 10px 20px;      /* внутренние отступы */
  max-width: 900px;
  margin: 20px auto;  /* сверху 20px, по бокам auto, снизу 60px */
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s ease-in-out;
}
/* Конкретно для блока преимуществ */
#advantages {
  margin-top: 80px;     /* сверху чуть меньше */
  margin-bottom: 20px;  /* снизу побольше */
  padding: 20px;        /* внутри */
}
.section.visible {
  opacity: 1;
  transform: translateY(0);
}
.section h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: #66fcf1;
}
.section.dark {
  background: #1f2833;
  color: #c5c6c7;
}

/* ===================== */
/* === ОБЩИЕ СТИЛИ === */
/* ===================== */
body {
  margin: 0;
  font-family: 'Press Start 2P', cursive;
  background-color: #0b0c10;
  color: #c5c6c7;
  line-height: 1.6;
  cursor: url('cursor.png'), auto; /* пиксельный курсор */
}
/* Эффект CRT (скан-линии по экрану) */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ===================== */
/* === ЛОАДЕР === */
/* ===================== */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0b0c10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #66fcf1;
  font-size: 1.2rem;
  z-index: 10000;
  text-align: center;
}
.loading-bar {
  width: 200px;
  height: 20px;
  border: 2px solid #66fcf1;
  margin-top: 20px;
  overflow: hidden;
}
.loading-progress {
  width: 0;
  height: 100%;
  background: #66fcf1;
  animation: load 3s forwards;
}
@keyframes load {
  to { width: 100%; }
}


/* ===================== */
/* === HERO ЭКРАН === */
/* ===================== */

/* Спрайты*/
.sprite {
  position: absolute;
  bottom: 0;
  z-index: 2;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease-out;
}
.sprite.left { left: 0%; }
.sprite.right { right: 0%; }

/* Название */
.hero {
  background: url('hero-bg.jpg') no-repeat center center/cover;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
/* затемнение */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}
/* блок с текстом */
.hero .overlay {
  position: absolute;      /* теперь абсолютно */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* по центру */
  z-index: 3;              /* поверх затемнения */
  max-width: 600px;
  padding: 0 20px;
  text-align: center;
  animation: fadeIn 2s ease-in-out;
}
/* Анимация появления */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Заголовок с глитч-эффектом */
.title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #66fcf1;
  animation: glitch 2s infinite;
}
@keyframes glitch {
  0% { text-shadow: 2px 2px #ff00c1, -2px -2px #00fff9; }
  20% { text-shadow: -2px -2px #ff00c1, 2px 2px #00fff9; }
  40% { text-shadow: 2px -2px #ff00c1, -2px 2px #00fff9; }
  60% { text-shadow: -2px 2px #ff00c1, 2px -2px #00fff9; }
  80% { text-shadow: 2px 2px #ff00c1, -2px -2px #00fff9; }
  100% { text-shadow: 0 0 10px #66fcf1; }
}
.subtitle {
  font-size: 1rem;
  margin-bottom: 30px;
  animation: fadeIn 3s ease-in-out;
}
.btn {
  display: inline-block;
  padding: 15px 30px;
  background: #45a29e;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.3s;
}
.btn:hover {
  background: #66fcf1;
  color: #0b0c10;
  transform: scale(1.1);
}

/* Canvas с частицами */
#bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* ниже всех секций */
  pointer-events: none; /* клики проходят сквозь */
}

/* Поднимаем все секции выше canvas */
.section {
  position: relative;
  z-index: 1;
}


/* ===================== */
/* === ЭФФЕКТ ПЕЧАТИ === */
/* ===================== */
.typing{
  position: relative;
  white-space: pre-wrap;       /* разрешаем переносы строк */
  word-wrap: break-word;
  min-height: 1.2em;           /* чтобы высота не прыгала в начале */
}

/* мигающий курсор */
.typing::after{
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  background: #66fcf1;
  vertical-align: -0.15em;
  animation: caretBlink .8s steps(1,end) infinite;
}

@keyframes caretBlink{
  50% { opacity: 0; }
}

#about p {
  text-align: center;
  margin: 0 auto;
  max-width: 700px; /* чтобы не растягивался слишком */
}

/* ===================== */
/* === ОСОБЕННОСТИ (карточки) === */
/* ===================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 40px;    /* горизонтальные отступы */
  row-gap: 60px;       /* вертикальные отступы */
  justify-items: center;
  margin-top: 50px;
}

.feature-card {
  width: 100%;
  max-width: 320px;
  height: 260px;        /* чуть выше, чтобы текст помещался */
  perspective: 1000px;
}
.feature-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.9s;
  transform-style: preserve-3d;
}
.feature-card:hover .feature-inner {
  transform: rotateY(180deg);
}
.feature-front, .feature-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
  border: 2px solid #66fcf1;
  border-radius: 10px;
  background: #1f2833;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 15px rgba(102, 252, 241, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-front h3 {
  font-size: 0.95rem;   /* уменьшили */
  margin-bottom: 10px;
  color: #66fcf1;
}
.feature-front p {
  font-size: 0.8rem;    /* уменьшили */
  color: #c5c6c7;
}
.feature-back {
  transform: rotateY(180deg);
  font-size: 0.78rem;   /* уменьшенный текст на обороте */
  line-height: 1.4;
  color: #c5c6c7;
  text-align: left;  /* аккуратно распределим */
  padding: 18px;
}

/* ===================== */
/* === НАШИ ПРЕИМУЩЕСТВА (круги) === */
/* ===================== */
.advantages-circles {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* 6 равных колонок */
  gap: 40px;
  justify-items: center;
  margin-top: 30px;
}

/* каждый круг занимает 2 колонки */
.circle { grid-column: span 2; }
/* нижний ряд: ставим 4-й и 5-й по центру — колонки 2-3 и 4-5 */
.circle:nth-child(4) { grid-column: 2 / span 2; }
.circle:nth-child(5) { grid-column: 4 / span 2; }

.circle {
  flex: 1 1 calc(33.33% - 40px); /* 3 в строке */
  max-width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: #0b0c10;
  background: radial-gradient(circle, #66fcf1, #1f2833);
  box-shadow: 0 0 20px #66fcf1, 0 0 40px rgba(102, 252, 241, 0.4);
  text-align: center;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
}

.circle::after {
  content: attr(data-text);
  position: absolute;
  top: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 12, 16, 0.9);
  color: #66fcf1;
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: 6px;
  width: max-content;
  max-width: 200px;       /* ограничим ширину */
  white-space: normal;    /* перенос строк разрешён */
  text-align: center;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 10px #66fcf1;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}
.circle:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}
.circle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 40px #66fcf1, 0 0 80px rgba(102, 252, 241, 0.7);
}
.glow {
  box-shadow: 0 0 40px #66fcf1, 0 0 80px rgba(102, 252, 241, 0.9);
}


/* ===================== */
/* === ГАЛЕРЕЯ === */
/* ===================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}
.gallery img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.7);
  transition: transform 0.3s;
}
.gallery img:hover {
  transform: scale(1.05);
}

/* Слайдер */
.slider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
}

.slides {
  display: flex;
  transition: transform 0.5s ease;
}
/*
.slides img {
  width: 300px;
  margin: 0 10px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.7);
} */

.slides img {
  flex: 0 0 auto;
  width: 280px;
  height: 180px;
  object-fit: cover;
  margin: 0 10px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.7);
}

/* Кнопки слайдера */
.slider button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: #66fcf1;
  font-size: 2rem;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
}

.slider .prev { left: 0; }
.slider .next { right: 0; }

.slider button:hover {
  color: #fff;
}

/* ===================== */
/* === LIGHTBOX (увеличение скринов) === */
/* ===================== */
.lightbox {
  display: none;                /* по умолчанию скрыто */
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  display: block;
  margin: 5% auto;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.lightbox .close:hover {
  color: #66fcf1;
}

/* ===================== */
/* === КОНТАКТЫ === */
/* ===================== */
.contacts .company {
  text-align: center;       /* центрируем ООО «ИБИТ» */
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #ffffff;           /* белый цвет */
}
.contacts .label {
  color: #66fcf1;       /* бирюзовый для подписей */
  font-weight: bold;
}
.contacts .value {
  color: #c5c6c7;       /* серый для значений */
}
.contacts a.value {
  color: #c5c6c7;       /* ссылки по умолчанию серые */
  text-decoration: none;
}
.contacts a.value:hover {
  color: #66fcf1;       /* при наведении — подсветка бирюзовым */
  text-decoration: underline;
}

/* ===================== */
/* === FOOTER === */
/* ===================== */
footer {
  background: #0b0c10;
  padding: 40px 20px;
  font-size: 0.75rem;
  color: #c5c6c7;
}
footer .footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap; /* на мобилках уйдет в столбик */
}
footer .fund-block {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 280px;
}
footer .fund-block img {
  height: 60px;
  flex-shrink: 0;
}
footer .fund-block p {
  margin: 0;
  line-height: 1.4;
}
footer .game-logo {
  height: 60px;
  flex-shrink: 0;
}

/* ===================== */
/* === АДАПТИВ Мобилки === */
/* ===================== */

/* hero */
@media (max-width: 900px) {
  .sprite { display: none; }
  .hero { justify-content: center; }
}

/* Особенности продукта - одна карточка на строку */
@media (max-width: 768px) {
  .features-grid {
    transform: translateX(-20px); /* сдвиг всего блока влево */

  }
  .feature-card {
    width: 85%;          /* уменьшаем ширину */
    max-width: 200px;    /* чуть меньше, чем на ПК */
    margin: 0 auto;
    height: auto;
    min-height: 180px;
  }
  .feature-front h3 {
    font-size: 0.85rem;  /* текст заголовка чуть меньше */
  }
  .feature-front p,
  .feature-back {
    display: flex;
    flex-direction: column;
    justify-content: center; /* центрируем по вертикали */
    align-items: center;     /* центрируем по горизонтали */
    text-align: center;      /* выравнивание текста */
  }
}

@media (max-width: 500px) {
  .feature-front h3 {
    font-size: 0.75rem;     /* немного меньше заголовок */
    margin-bottom: 8px;
  }

  .feature-front p {
    font-size: 0.65rem;     /* уменьшили шрифт описания */
    line-height: 1.3;
    word-break: break-word;
    text-align: center;
    margin: 0 auto;
    max-width: 90%;         /* чтобы текст не прижимался к краям */
  }

  .feature-inner,
  .feature-card:hover .feature-inner {
    transform: none !important;
  }

  .feature-card {
    min-height: 160px;      /* чтобы всё поместилось красиво */
  }
}

/* Наши преимущества - по одному кружку */
@media (max-width: 768px) {
  .advantages-circles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    justify-content: center;
    justify-items: center;
    margin: 0 auto;
    max-width: 300px;
  }
  
  .circle {
    width: 150px;
    height: 150px;
    font-size: 0.75rem;
    padding: 8px;
    margin: 0 auto;
  }
  
  /* Первые четыре кружка в двух колонках */
  .circle:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  
  .circle:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  
  .circle:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }
  
  .circle:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }
  
  /* Пятый кружок посередине между столбцами */
  .circle:nth-child(5) {
    grid-column: 1 / span 2;
    grid-row: 3;
    justify-self: center;
    margin-top: 10px;
  }
  
  .circle::after {
    top: 130px;
    font-size: 0.65rem;
    max-width: 150px;
  }
}

/* Адаптив Галлерея */
@media (max-width: 900px) {
  .slides img { width: 250px; }
}
@media (max-width: 600px) {
  .slides img { width: 200px; }
}

/* Контакты - перенос "г." */
@media (max-width: 768px) {
  .contacts .value {
    display: block; /* чтобы всегда переносилось */
  }
}

/* Футер - лого сверху, текст снизу */
@media (max-width: 768px) {
  footer .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  footer .fund-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  footer .fund-block img,
  footer .game-logo {
    margin-bottom: 15px;
  }
}
