/* Сброс базовых стилей */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  margin:    0 auto;
  max-width: 1280px;
  scroll-behavior: smooth;
}

body { font-family: 'Inter', sans-serif; color: #000000;}
a { text-decoration: none; color: inherit; }

.header {
  display: flex;
  position: sticky;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 1000;
  margin: 0 auto;
}

.header nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.header nav a {
  margin-left: 16px;
  color: #555;
  transition: color 0.2s;
  text-decoration: none;
  font-size: 14px;
  font-weight:700;
}

.header nav a:hover {
  background: linear-gradient(to right, #3F8CEF, #B668E2, #E0545B, #E3612A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header img.button-logotop {
  width: 111px;
  height: 40px;
  display: block;
  transition: transform 0.2s;
}

.header nav a.active {
  color: #2F70DB;
}

/* ===== Mobile navigation ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  z-index: 1100;
  border-radius: 10px;
  transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(0,0,0,0.04); }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #222;
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.nav-toggle span + span { margin-top: 5px; }

body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.menu-open { overflow: hidden; }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 88%;
  max-width: 360px;
  padding: 24px;
}
.mobile-menu nav a {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  padding: 16px 18px;
  color: #1a1a1a;
  border-radius: 14px;
  background: rgba(0,0,0,0.04);
  text-decoration: none;
  transform: translateY(8px);
  opacity: 0;
  transition: background 0.2s, transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease;
}
.mobile-menu.open nav a { transform: translateY(0); opacity: 1; }
.mobile-menu nav a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu nav a:nth-child(2) { transition-delay: 0.10s; }
.mobile-menu nav a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu nav a:nth-child(4) { transition-delay: 0.20s; }
.mobile-menu nav a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu nav a:nth-child(6) { transition-delay: 0.30s; }
.mobile-menu nav a:nth-child(7) { transition-delay: 0.35s; }
.mobile-menu nav a:hover { background: rgba(0,0,0,0.07); }
.mobile-menu nav a.active {
  color: #fff;
  background: linear-gradient(135deg, #3F8CEF, #B668E2 45%, #E0545B 75%, #E3612A);
  box-shadow: 0 8px 22px rgba(176,80,180,0.25);
}

@media (max-width: 768px) {
  .header { justify-content: space-between; padding: 14px 18px; }
  .header nav { gap: 0; margin: 0; flex: 0 0 auto; }
  .header nav a { margin-left: 0; }
  /* На мобиле в шапке оставляем только лого (первая ссылка) */
  .header nav a:not(:first-child) { display: none; }
  .nav-toggle { display: inline-flex; }
  .header img.button-logotop { width: 88px; height: 32px; }
}

@media (min-width: 769px) {
  /* На десктопе мобильное меню скрыто полностью */
  .mobile-menu { display: none; }
  .nav-toggle { display: none; }
}

/* ===== Floating "scroll to top" button ===== */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3F8CEF, #B668E2 45%, #E0545B 75%, #E3612A);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}
@media (max-width: 700px) {
  .to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; font-size: 18px; }
}

.hero {
  text-align: center; padding: 0px 0px;
}
.hero h1 {
  font-size: 44px; font-weight:400;
  margin-top:20px;
  margin-bottom:20px;
}
.hero .question {
  text-align: left;
  font-family: Menlo, monospace;
  font-size: 16px;
  background: #f5f5f5;
  padding: 12px 16px;
  border-radius: 6px;
  display: inline-block;
  margin-left:16px;
  margin-right:16px;
}

.cursor {
  display: inline-block;
  animation: blink 0.8s infinite;
  color: black;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.quick-links {
  align-items: center;
  padding: 30px 20px;
  gap: 20px;
}
.quick-links h3 {
  font-size: 24px;
  font-weight: 400;
  margin-bottom:10px;
}
.quick-links .btn-group {
  display: inline-flex; gap: 10px;
}

.quick-links .btn {
  padding: 10px 20px; border-radius: 35px; border: 1px solid #2F70DB;
  background: white; color: #2F70DB; transition: background .2s, color .2s;
}

.quick-links .btn.primary {
  background: #2F70DB; color: white;
}
.quick-links .btn:hover {
  background: #2F70DB;
  color: #ffffff;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 20px;
  padding: 0px;
}

.category {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: #F5F5F7;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 0px 0px rgba(0,0,0,.02);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 220px;
  text-align: center;
  overflow: hidden;
}

.category:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 5px rgba(0,0,0,.025);
}

.category-title {
  font-weight: 500;
  font-size:24px;
  margin-bottom: 9px;
  line-height:140%;
  max-width: 320px;
}

.category-image {
  object-fit: contain;
  border-radius: 6px;
}

.app-info {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  padding: 40px 20px; gap: 40px;
}
.logo-block { text-align: center; }
.logo-block h1 { font-size: 132px; margin-bottom: 20px; }
.logo-block h2 { font-size: 132px; font-weight:600;}
.logo-block h3 { font-size: 24px; color:#7C7C7C;}
.app-logo {
  width: 270px; height: 270px; background: #eee;
}



.screenshots {
  display: flex; gap: 49px;
}

.screenshot.placeholder {
  width: 325px; height: 666px; border-radius: 16px;
  transition: filter .3s;
}

.access-levels {
  padding: 20px 20px;
}

.access-levels h3 {
  font-size:24px;
  font-weight:400;
  text-align: left;
  margin-bottom:10px;
  margin-left:20px;
}

.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 20px;
  padding: 0px;
}

.level {
  height: 300px;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,.1);
  cursor: pointer;
  transition: transform 0.3s;
}

.level:hover {
  transform: translateY(-4px);
}

.level img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

.level-info {
  position: absolute;
  inset: 0;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: left;
  gap: 8px;
  font-size: 14px;
  line-height: 140%;
  border-radius: 32px;
  white-space: pre-line;
  pointer-events: none;
}

.level:hover img {
  opacity: 0;
}

.level:hover .level-info {
  opacity: 1;
}


.benefits {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px;
}

.benefits ul {
  list-style: none;
  padding: 0;
  text-align: center;
}

.benefits li {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 400;
}

.video-gallery {
  padding: 20px 20px;
}

.video-gallery h3 {
  font-size: 24px;
  font-weight: 400;
  text-align: left;
  margin-bottom: 10px;
  margin-left: 20px;
}

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 20px;
  padding: 20px;
}

.video-item {
  height: 300px; /* Для горизонтальных видео */
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s;
  position: relative;
}

.video-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 0px 8px rgba(0,0,0,.12);
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-content {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Для горизонтальных пропорций */
  display: block;
}

.video-item:hover .video-content {
  opacity: 1; /* Для совместимости, хотя здесь не меняется */
}

.about {
  background-color: #F5F5F7;
  padding: 40px 20px;
  line-height:140%;
  border-radius:20px;
}
.about h3 {
  margin-bottom: 20px;
  margin-left: 16px;
  font-size: 24px;
  font-weight: 500;
  line-height:170%;
}
.about p, .about ul {
  margin-left: 16px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 400;
  line-height:170%;
}

.link_about {
  color: #2F70DB;
}

.link_about:hover {
  background: linear-gradient(to right, #3F8CEF, #B668E2, #E0545B, #E3612A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about ul {
  list-style: none;
  padding-left: 0;
}


.footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 30px 0px;
  gap: 20px;
}

.footer-buttons .btn {
  padding: 10px 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: #2F70DB;
  color: #fff;
  width: auto;
  height: 55px;
  margin: 0 10px;
  text-decoration: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  font-weight: 400;
  border-radius: 35px;
  
}

.footer-buttons .btn .footer_img {

 margin-right: 12px;

}


.footer img.button-download {
  width: 162px;
  height: 55px;
}

.hero, .categories, .app-info, .access-levels, .about, .video-gallery {
  scroll-margin-top: 20px; /* Смещение точки скролла, чтобы учесть высоту хедера */
}

/* Медиа-запрос для мобильных устройств (ширина до 768px) */
@media (max-width: 768px) {
  .categories {
    grid-template-columns: repeat(auto-fit, minmax(295px, 1fr)); /* Меньшая минимальная ширина */
  }

  .levels {
    grid-template-columns: repeat(auto-fit, minmax(295px, 1fr)); /* Меньшая минимальная ширина */
  }

  .videos {
    grid-template-columns: repeat(auto-fit, minmax(295px, 1fr)); /* Меньшая минимальная ширина, адаптивно */
    grid-template-rows: auto; /* Автоматические строки */
  }

  .category, .level, .video-item {
    height: 180px; /* Уменьшенная высота для мобильных */
  }

  .category-title {
    font-size: 18px; /* Меньший шрифт для текста */
  }

  .video-content, .video-preview {
    object-fit: cover; /* Сохраняем пропорции */
  }
  
  .footer {
    display: flex;
    flex-direction: column; /* Вертикальное расположение */
    align-items: center; /* Центрирование по горизонтали */
    padding: 30px 20px;
    gap: 20px; /* Расстояние между элементами */
  }

  .footer-buttons {
    display: flex;
    flex-direction: column; /* Кнопки друг под другом */
    align-items: center; /* Центрирование кнопок */
    gap: 8px; /* Расстояние между кнопками */
    width: 100%;
  }

  .footer-buttons .btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #2F70DB;
    color: #fff;
    width: 100%; /* Фиксированная ширина для единообразия */
    height: 55px;
    text-decoration: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    font-weight: 400;
    border-radius: 35px;
    transition: background 0.2s;
  }
  
  .quick-links .btn-group {
    flex-direction: column; /* Вертикальное расположение для мобильных */
    gap: 8px; /* Уменьшенный отступ */
    align-items: center; /* Центрирование */
    width: 100%;
  }
  
  .header nav {
    flex-direction: column; /* Вертикальное расположение для мобильных */
    gap: 8px; /* Уменьшенный отступ */
    align-items: center; /* Центрирование */
    width: 100%;
  }
  
  .quick-links .btn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
  }
  
  .screenshots {
    flex-direction: column; /* Вертикальное расположение для мобильных */
    gap: 20px; /* Уменьшенный отступ */
    align-items: center; /* Центрирование */
  }

  .screenshot.placeholder {
    width: 100%; /* Полная ширина экрана */
    height: auto; /* Автоматическая высота для сохранения пропорций */
    max-width: 300px; /* Ограничение максимальной ширины */
    border-radius: 8px;
  }
  
  /* Заголовки */
  .hero h1 {
    font-size: 32px; /* Было 44px */
  }

  .quick-links h3,
  .access-levels h3,
  .video-gallery h3,
  .about h3 {
    font-size: 20px; /* Было 24px */
  }

  .logo-block h2 {
    font-size: 80px; /* Было 132px */
  }

  .logo-block h3 {
    font-size: 20px; /* Было 24px */
  }

  /* Текст в категориях */
  .category-title {
    font-size: 18px; /* Было 24px */
  }

  /* Текст в уровнях доступа */
  .level-info {
    font-size: 12px; /* Было 14px */
  }

  /* Текст в преимуществах */
  .benefits li {
    font-size: 20px; /* Было 24px */
  }

  /* Текст в разделе "Обо мне" */
  .about p,
  .about ul {
    font-size: 16px; /* Было 20px */
  }

  /* Текст в кнопках футера */
  .footer-buttons .btn {
    font-size: 20px; /* Было 24px */
  }
}
