/* Мобильная оптимизация - отключаем сложные эффекты */
@media screen and (max-width: 768px) {
    /* Отключаем анимированный фон canvas */
    #bg-canvas {
      display: none;
    }
    
    /* Отключаем 3D-эффекты карточек */
    .why-card {
      transform: none !important;
      transition: none !important;
    }
    
    .why-card:hover {
      transform: none !important;
      box-shadow: 0 0 20px rgba(93, 50, 249, 0.15) !important;
    }
    
    /* Упрощаем анимации кнопок */
    .but:hover {
      transform: scale(1.05) !important;
      box-shadow: 0 0 8px 1px #5d32f9 !important;
    }
    
    /* Отключаем плавающие анимации */
    .icon {
      animation: none !important;
    }
    
    /* Упрощаем header */
    .header {
      padding: 15px 10px;
      flex-direction: row !important;
      justify-content: space-between !important;
      flex-wrap: wrap;
    }
    
    .header .logo {
      font-size: 14px;
      width: 100%;
      text-align: center;
      margin-bottom: 10px;
    }
    
    .header .menu,
    .header .vk-tg {
      width: auto;
    }
    
    /* Улучшаем отображение контента */
    .content .hello {
      margin-top: 50px;
      min-height: 50vh;
    }
    
    .content .hello .logo {
      font-size: 2.5rem !important;
      padding-top: 20px;
    }
    
    .post .one-text {
      font-size: 18px !important;
      line-height: 1.4;
    }
    
    /* Оптимизируем секцию "Почему я" */
    .why-me {
      padding: 4rem 0 !important;
    }
    
    .why-me .section-title {
      font-size: 2rem !important;
      animation: none;
      background: #5d32f9;
      -webkit-text-fill-color: #5d32f9;
    }
    
    .why-grid {
      grid-template-columns: 1fr !important;
      gap: 1.5rem !important;
    }
    
    /* Оптимизируем карточку разработчика */
    .about-dev {
      padding: 1rem 0;
    }
    
    .dev-card {
      padding: 1.5rem !important;
    }
    
    .dev-header {
      flex-direction: column;
      text-align: center;
      gap: 1rem !important;
    }
    
    .dev-info .contacts {
      justify-content: center;
    }
    
    .dev-body {
      grid-template-columns: 1fr !important;
      gap: 1.5rem !important;
    }
    
    .stack-list {
      grid-template-columns: 1fr !important;
    }
    
    /* Оптимизируем секцию достижений */
    .step-3 .rewards {
      margin-top: 80px !important;
      grid-gap: 80px !important;
    }
    
    .reward h1 {
      font-size: 2rem !important;
      line-height: 1.2;
    }
    
    .reward p {
      font-size: 16px !important;
    }
    
    /* Улучшаем навигационные кнопки */
    .but-nav {
      position: fixed;
      bottom: 5px;
      left: 5px;
      flex-direction: row;
    }
    
    .but-nav .but {
      font-size: 12px;
      padding: 8px 12px;
    }
    
    /* Упрощаем футер */
    .footer {
      padding: 30px 10px 15px;
      text-align: center;
    }
    
    /* Улучшаем модальное окно */
    .modal .close {
      top: 15px;
      right: 20px;
      font-size: 30px;
    }
    
    .modal .modal-content {
      max-width: 95%;
      max-height: 85%;
    }
    
    /* Отключаем сложные градиенты body */
    body::before,
    body::after {
      display: none;
    }
    
    /* Упрощаем background для лучшей производительности */
    body {
      background: #0d0d0d;
    }
  }
  
  /* Дополнительные оптимизации для очень маленьких экранов */
  @media screen and (max-width: 480px) {
    .content .hello .logo {
      font-size: 2rem !important;
    }
    
    .post .one-text {
      font-size: 16px !important;
    }
    
    .why-me .section-title {
      font-size: 1.8rem !important;
    }
    
    .reward h1 {
      font-size: 1.8rem !important;
    }
    
    .header .menu ul,
    .footer .menu ul {
      grid-gap: 10px !important;
    }
    
    .but {
      padding: 8px 12px;
      font-size: 14px;
    }
    
    .list-flex {
      flex-direction: column;
      gap: 8px;
    }
    
    .dev-card {
      padding: 1rem !important;
    }
  }

  /* Дополнительные исправления для блока about-dev на мобилках */
@media screen and (max-width: 768px) {
    .about-dev .container {
      padding: 0 10px;
      width: 100%;
      max-width: 100%;
    }
    
    .about-dev .dev-card {
      margin: 0 auto;
      width: 100%;
      border-radius: 16px;
      padding: 1.2rem !important;
    }
    
    .about-dev .dev-header {
      flex-direction: column;
      text-align: center;
      gap: 1.2rem !important;
      margin-bottom: 1.5rem !important;
    }
    
    .about-dev .dev-photo {
      width: 100px !important;
      height: 100px !important;
      border-radius: 12px !important;
    }
    
    .about-dev .dev-info h2 {
      font-size: 1.4rem !important;
      line-height: 1.2;
    }
    
    .about-dev .dev-info .role {
      font-size: 1rem !important;
      margin: 0.5rem 0 !important;
    }
    
    .about-dev .dev-info .motto {
      font-size: 0.9rem !important;
      line-height: 1.4;
      margin-bottom: 1rem !important;
    }
    
    .about-dev .dev-info .contacts {
      justify-content: center !important;
      gap: 0.5rem !important;
      flex-wrap: wrap;
    }
    
    .about-dev .dev-info .contacts .but {
      font-size: 0.85rem !important;
      padding: 0.5rem 0.8rem !important;
      min-width: auto;
    }
    
    .about-dev .dev-body {
      grid-template-columns: 1fr !important;
      gap: 1.5rem !important;
      margin-bottom: 1.5rem !important;
    }
    
    .about-dev .dev-text h3 {
      font-size: 1.2rem !important;
      text-align: center;
    }
    
    .about-dev .dev-text p {
      font-size: 0.9rem !important;
      line-height: 1.5;
      text-align: center;
    }
    
    .about-dev .traits {
      gap: 0.5rem !important;
    }
    
    .about-dev .traits div {
      padding: 0.5rem 0.8rem !important;
      font-size: 0.85rem !important;
      text-align: center;
      border-radius: 8px !important;
    }
    
    .about-dev .traits div:hover {
      transform: none !important;
    }
    
    .about-dev .dev-stack h4 {
      font-size: 1.1rem !important;
      text-align: center;
      margin-bottom: 1rem !important;
    }
    
    .about-dev .stack-list {
      grid-template-columns: 1fr !important;
      gap: 0.4rem !important;
    }
    
    .about-dev .stack-list li {
      font-size: 0.9rem !important;
      padding: 0.4rem 0 0.4rem 1rem !important;
      text-align: center;
    }
    
    .about-dev .dev-footer {
      padding-top: 1.2rem !important;
    }
    
    .about-dev .dev-footer p {
      font-size: 0.9rem !important;
      margin-bottom: 1rem !important;
      line-height: 1.4;
    }
    
    .about-dev .dev-footer .but.large {
      width: 100% !important;
      padding: 0.8rem 1rem !important;
      font-size: 0.95rem !important;
    }
  }
  
  /* Дополнительные исправления для очень маленьких экранов */
  @media screen and (max-width: 480px) {
    .about-dev .dev-card {
      padding: 1rem !important;
      border-radius: 12px;
    }
    
    .about-dev .dev-photo {
      width: 90px !important;
      height: 90px !important;
    }
    
    .about-dev .dev-info h2 {
      font-size: 1.3rem !important;
    }
    
    .about-dev .dev-info .contacts {
      flex-direction: column;
      align-items: center;
    }
    
    .about-dev .dev-info .contacts .but {
      width: 100%;
      max-width: 200px;
      text-align: center;
    }
    
    .about-dev .traits div {
      font-size: 0.8rem !important;
      padding: 0.6rem 0.5rem !important;
    }
    
    .about-dev .stack-list li {
      font-size: 0.85rem !important;
    }
  }
  
  /* Исправление отступов для всего контента */
  @media screen and (max-width: 768px) {
    .content .container {
      padding: 0 15px;
    }
    
    main.content {
      padding: 20px 0 10px !important;
    }
    
    section.about-dev {
      margin: 2rem 0 !important;
      padding: 0 !important;
    }
  }
  /* Исправление контейнеров на маленьких экранах */
@media screen and (max-width: 400px) {
    .container {
      width: 100% !important;
      max-width: 100% !important;
      padding: 0 10px !important;
      margin: 0 auto !important;
    }
    
    main.content .container {
      padding: 0 8px !important;
    }
    
    .content {
      overflow-x: hidden;
    }
    
    /* Исправление для всех секций */
    section {
      width: 100%;
      overflow: hidden;
    }
  }
  
  /* Атомарные исправления для текста */
  @media screen and (max-width: 400px) {
    .about-dev .dev-info h2 {
      font-size: 1.15rem !important;
      line-height: 1.1;
      margin: 0;
    }
    
    .about-dev .dev-info .motto {
      font-size: 0.82rem !important;
      line-height: 1.2;
      margin: 0.3rem 0 0.8rem 0 !important;
    }
  }

  /* Простое исправление для 770px */
@media screen and (max-width: 770px) {
    .about-dev.container {
      margin-left: auto !important;
      margin-right: auto !important;
      padding-left: 20px !important;
      padding-right: 20px !important;
    }
    
    .about-dev .dev-card {
      margin-left: auto !important;
      margin-right: auto !important;
    }
  }
  
  /* Атомарное исправление */
  @media screen and (max-width: 770px) {
    section.about-dev {
      margin-left: 0 !important;
      padding-left: 0 !important;
      transform: none !important;
    }
    
    .about-dev .container {
      margin-left: auto !important;
      margin-right: auto !important;
      padding-left: 15px !important;
      padding-right: 15px !important;
    }
  }

  /* Исправление для экранов 558px и меньше */
@media screen and (max-width: 558px) {
    .about-dev {
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
      width: 100% !important;
      margin: 0 auto !important;
      padding: 0 10px !important;
    }
    
    .about-dev .container {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 auto !important;
      padding: 0 !important;
      display: flex !important;
      justify-content: center !important;
    }
    
    .about-dev .dev-card {
      width: 100% !important;
      max-width: 500px !important;
      margin: 0 auto !important;
      padding: 1.2rem !important;
    }
    
    /* Исправление структуры */
    .about-dev .dev-header {
      flex-direction: column !important;
      text-align: center !important;
      gap: 1rem !important;
    }
    
    .about-dev .dev-info .contacts {
      justify-content: center !important;
      flex-wrap: wrap;
    }
    
    .about-dev .dev-info .contacts .but {
      min-width: 120px;
    }
  }
  
  /* Конкретно для диапазона 480px - 558px */
  @media screen and (min-width: 480px) and (max-width: 558px) {
    .about-dev .dev-card {
      max-width: 450px !important;
    }
    
    .about-dev .dev-header {
      flex-direction: row !important;
      text-align: left !important;
      gap: 1.5rem !important;
    }
    
    .about-dev .dev-photo {
      width: 100px !important;
      height: 100px !important;
    }
  }
  
  /* Гарантированное центрирование для всех маленьких экранов */
  @media screen and (max-width: 558px) {
    body .container {
      width: 100% !important;
      max-width: 100% !important;
      padding-left: 15px !important;
      padding-right: 15px !important;
      margin-left: auto !important;
      margin-right: auto !important;
    }
    
    main.content .container {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
    }
    
    section.about-dev {
      align-self: center !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
    }
  }
  
  /* Экстренное исправление смещения */
  @media screen and (max-width: 558px) {
    .about-dev.container {
      transform: none !important;
      left: auto !important;
      right: auto !important;
    }
    
    .about-dev .dev-card {
      margin-left: auto !important;
      margin-right: auto !important;
      transform: none !important;
    }
  }
  
  /* Исправление отступов контента */
  @media screen and (max-width: 558px) {
    .content {
      padding-left: 0 !important;
      padding-right: 0 !important;
    }
    
    .content .container {
      padding-left: 10px !important;
      padding-right: 10px !important;
    }
  }