/* ==========================================================================
   1. ОБЩИЕ НАСТРОЙКИ И ПЕРЕМЕННЫЕ
   ========================================================================== */
:root {
  --bg-color: #050409;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.06);
  --text-color: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --accent: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.5);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
}

body {
  overflow-x: hidden;
  padding-top: 54px;
}

section[id] {
  scroll-margin-top: 84px;
}

/* ==========================================================================
   2. ФОНОВЫЕ ЭФФЕКТЫ
   ========================================================================== */
.glow-bg {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0,0,0,0) 70%);
  z-index: -2;
  pointer-events: none;
  filter: blur(80px);
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   3. НАВИГАЦИЯ (APPLE PREMIUM STYLE)
   ========================================================================== */
.apple-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 54px;
  background: rgba(5, 4, 9, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 999;
}

.nav-container {
  max-width: 1100px;
  width: 90%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  z-index: 1001;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links .nav-cta {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 5px 14px;
  border-radius: 8px;
  color: #c084fc;
  font-weight: 500;
}

.nav-links .nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Иконка бургер-меню (2 геометрически точные полоски) */
.menu-toggle {
  display: none;
  width: 22px;
  height: 12px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  position: absolute;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), top 0.3s ease, opacity 0.3s;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }

/* Идеальный симметричный крестик без перекосов */
.menu-toggle.active span:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  top: 5px;
  transform: rotate(-45deg);
}

/* ==========================================================================
   4. ГЛАВНЫЙ КОНТЕЙНЕР И КАРТОЧКИ
   ========================================================================== */
.main-wrapper {
  max-width: 1100px;
  width: 90%;
  margin: 0 auto;
  padding: 40px 0 20px 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
}

/* ==========================================================================
   5. ГЕРОЙ (HERO BOX)
   ========================================================================== */
.hero-box {
  text-align: center;
  padding: 60px 0 40px 0;
}

.hero-box h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--text-muted);
}

.highlight {
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent-glow);
}

/* ==========================================================================
   6. СЕКЦИЯ "ОБО МНЕ" И СТАТИСТИКА
   ========================================================================== */
.about-card {
  text-align: left;
}

.name-badge {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.tagline {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 800px;
  margin-bottom: 30px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: #fff;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
}

.stats-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  padding: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-item:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   7. СЕТКА ВИДЕОКАРТОЧЕК
   ========================================================================== */
.video-grid {
  display: grid;
  gap: 24px;
}

.vertical-container {
  grid-template-columns: repeat(3, 1fr);
}

.horizontal-container {
  grid-template-columns: repeat(2, 1fr);
}

.video-card {
  display: flex;
  flex-direction: column;
}

.custom-player {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.custom-player.horizontal {
  aspect-ratio: 16 / 9;
}

.video-tag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-ui {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 15px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.custom-player:hover .player-ui,
.custom-player.playing .player-ui {
  opacity: 1;
}

.timeline-container {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
}

.timeline {
  width: 100%;
  height: 100%;
}

.bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls .left, .controls .right {
  display: flex;
  gap: 14px;
}

.controls button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.1s;
  padding: 4px;
}

.controls button:hover {
  opacity: 1;
  transform: scale(1.1);
}

.video-details {
  padding-top: 14px;
  text-align: left;
}

.video-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
  color: #fff;
}

.video-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 4px;
}

.video-link:hover {
  text-decoration: underline;
}

.video-views {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   8. НАВЫКИ И СКИЛЛЫ
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.skill-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 16px 24px;
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.skill-card:hover {
  transform: translateY(-4px) scale(1.015);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.12);
}

.skill-icon-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skill-card span {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ==========================================================================
   9. КОНТАКТЫ
   ========================================================================== */
.contact-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-stack .btn {
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
  padding: 16px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.95rem;
  /* Анимация (transition) один в один как у карточек скиллов */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

/* Полностью убираем отсюда раздельные ховеры, чтобы они ничего не ломали */
/* ==========================================================================
   10. ФУТЕР И АДАПТИВНОСТЬ
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 24px 0;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.site-footer p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}

@media (max-width: 900px) {
  .vertical-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block; 
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%; 
    width: 280px;  
    height: 100vh;
    background: rgba(10, 9, 18, 0.94); 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start; 
    padding: 100px 32px 40px 32px; 
    gap: 24px;
    transition: right 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    width: 100%;
    text-align: left; 
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); 
  }

  .nav-links .nav-cta {
    display: block;
    text-align: center; 
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    border: none;
    margin-top: 10px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
  }
  
  .hero-box h1 {
    font-size: 2.6rem;
  }
  
  .card {
    padding: 24px;
  }
  
  .vertical-container, .horizontal-container {
    grid-template-columns: 1fr;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-banner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-item:first-child {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
  }
}

/* ==========================================================================
   11. ФИКС ИСКАЖЕНИЯ ВИДЕО В ПОЛНОЭКРАННОМ РЕЖИМЕ
   ========================================================================== */
.custom-player:fullscreen .video-tag,
.custom-player:-webkit-full-screen .video-tag {
  object-fit: contain !important;
  width: 100%;
  height: 100%;
}

.custom-player:fullscreen .player-ui,
.custom-player:-webkit-full-screen .player-ui {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2147483647; 
}

/* ==========================================================================
   12. СТИЛИЗАЦИЯ КНОПОК ПОД ФИОЛЕТОВУЮ ЭСТЕТИКУ
   ========================================================================== */
.btn {
  /* Базовый транзишн дублируем для надежности */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

/* Клонируем поведение .skill-card:hover один в один */
.btn:hover, .btn:focus-within {
  transform: translateY(-4px) scale(1.015);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.12); /* То самое мягкое фиолетовое свечение */
}

.btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  color: #a855f7; 
}

.btn:hover i {
  transform: scale(1.1);
  color: #c084fc; 
}
