/* Базовые стили */
:root {
  --primary: #7b5cff;
  --primary-dark: #6a4ce6;
  --secondary: #6afaff;
  --accent: #b983ff;
  --dark: #0a0a1a;
  --darker: #050510;
  --medium: #1a1a2e;
  --light: #2d2d4d;
  --text: #ffffff;
  --text-secondary: #a0a0c0;
  --glass: rgba(30, 30, 60, 0.4);
  --glass-border: rgba(123, 92, 255, 0.2);
  --success: #00ff88;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Exo 2', sans-serif;
  background: var(--darker);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(123, 92, 255, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(106, 250, 255, 0.1) 0%, transparent 40%);
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1001;
  background: rgba(123, 92, 255, 0.2);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 2px;
  background: var(--secondary);
  margin: 3px 0;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Плавающее меню */
.floating-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
}

.floating-nav.scrolled {
  background: rgba(10, 10, 20, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.floating-nav.hidden {
  transform: translateY(-100%);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.2rem;
}

.logo-cube {
  color: var(--primary);
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary);
  background: rgba(123, 92, 255, 0.1);
}

.nav-link i {
  font-size: 1.1rem;
}

/* Основной контент */
.main-content {
  padding-top: 70px;
}

section {
  min-height: 100vh;
  padding: 4rem 0;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Главная секция */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.home-content {
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(123, 92, 255, 0.2);
  color: var(--secondary);
  border: 1px solid var(--glass-border);
  border-radius: 25px;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--secondary), var(--accent), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 4rem;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
}

.scroll-line {
  width: 2px;
  height: 30px;
  background: var(--primary);
  margin: 0 auto;
  animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(10px); }
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(123, 92, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Glass эффект */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Анимации */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* Дополнительные стили для остальных секций */
.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
}

.feature i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--medium);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(123, 92, 255, 0.2);
}

.project-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

.project-card h3 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.project-card p {
  flex: 1;
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  justify-content: center;
}

.project-tech span {
  background: rgba(123, 92, 255, 0.2);
  color: var(--secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--medium);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.skill-item {
  margin: 1rem 0;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.skill-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 1.5s ease-in-out;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-details {
  margin: 2rem 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.contact-item i {
  font-size: 1.2rem;
  color: var(--primary);
  width: 24px;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: pointer;
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.form-group {
  margin: 1.2rem 0;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  cursor: text;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(123, 92, 255, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.footer {
  background: var(--dark);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Canvas фон */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Стандартный курсор для всех элементов */
* {
  cursor: auto;
}

/* Особые курсоры для интерактивных элементов */
a, button, .btn, .nav-link, .social-link,
input, textarea, .project-card {
  cursor: pointer;
}

input, textarea {
  cursor: text;
}

/* Улучшенная анимация для карточек проектов */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(106, 250, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.project-card:hover::before {
  left: 100%;
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 968px) {
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .about-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .floating-nav {
    transform: translateX(-100%);
    width: 280px;
    height: 100vh;
    background: rgba(10, 10, 25, 0.98);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 2rem 0;
    transition: transform 0.3s ease;
  }
  
  .floating-nav.active {
    transform: translateX(0);
  }
  
  .nav-container {
    flex-direction: column;
    height: 100%;
    padding: 0;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem;
  }
  
  .nav-link {
    padding: 1rem;
    justify-content: center;
  }
  
  .nav-link span {
    display: inline;
    font-size: 1.1rem;
  }
  
  .main-content {
    padding-top: 0;
    margin-left: 0;
  }
  
  .gradient-text {
    font-size: 2.8rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    margin: 0.5rem 0;
  }
  
  section {
    padding: 3rem 0;
    min-height: auto;
  }
  
  .section-container {
    padding: 0 1.5rem;
  }
  
  .section-header h2 {
    font-size: 2.2rem;
  }
  
  .glass {
    padding: 1.5rem;
    margin: 0 1rem;
  }
  
  .project-card {
    padding: 1.5rem;
  }
  
  .skill-category {
    padding: 1.5rem;
  }
  
  .contact-item span {
    font-size: 0.9rem;
    word-break: break-all;
  }
  
  .floating-nav.scrolled,
  .floating-nav.hidden {
    transform: translateX(-100%);
  }
  
  .floating-nav.scrolled.active,
  .floating-nav.hidden.active {
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .gradient-text {
    font-size: 2.2rem;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .hero-badge {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
  
  .project-tech {
    justify-content: center;
  }
  
  .project-tech span {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  
  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .contact-item i {
    font-size: 1.5rem;
  }
  
  .social-links {
    flex-wrap: wrap;
  }
  
  .social-link {
    width: 45px;
    height: 45px;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 0.8rem;
  }
  
  .footer-content {
    padding: 0 1rem;
  }
  
  .footer-logo {
    font-size: 1rem;
  }
  
  .footer p {
    font-size: 0.9rem;
  }
}

/* Исправление багов для мобильной версии */
@media (max-width: 768px) {
  /* Фикс для скролла на iOS */
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Фикс для viewport на iOS */
  @supports (-webkit-touch-callout: none) {
    .home {
      min-height: -webkit-fill-available;
    }
  }
  
  /* Фикс для анимаций на мобильных устройствах */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  /* Улучшение touch targets для мобильных */
  .nav-link,
  .btn,
  .social-link,
  .contact-item {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Предотвращение масштабирования при фокусе на iOS */
  input, textarea {
    font-size: 16px;
  }
  
  /* Улучшение читаемости текста на мобильных */
  body {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
  }
}

/* Фикс для backdrop-filter на некоторых мобильных браузерах */
@supports not (backdrop-filter: blur(20px)) {
  .floating-nav,
  .glass {
    background: rgba(10, 10, 25, 0.95);
  }
}

/* Фикс для анимаций в Firefox Mobile */
@-moz-document url-prefix() {
  @media (max-width: 768px) {
    .floating-nav {
      transition: transform 0.3s ease;
    }
  }
}