/* Базовые стили */
:root {
  /* Основные цвета */
  --primary-color: #9b4dff;
  --primary-color-light: #af6dff;
  --primary-gradient: linear-gradient(135deg, #9b4dff 0%, #6825e3 100%);
  --primary-gradient-hover: linear-gradient(135deg, #8a3cee 0%, #5714d2 100%);
  --accent-color: #ff44b4;
  --accent-color-light: #ff65c3;
  --accent-gradient: linear-gradient(135deg, #ff44b4 0%, #b81984 100%);
  
  /* Текстовые цвета */
  --text-primary: #f2f3f5;
  --text-secondary: #a0a5b1;
  
  /* Фоновые цвета */
  --bg-primary: #0f0e19;
  --bg-secondary: #17162a;
  --bg-card: #1e1d32;
  --bg-elevated: #252540;
  
  /* Границы */
  --border-color: rgba(123, 97, 255, 0.15);
  --shadow-color: rgba(101, 73, 240, 0.2);
  
  /* Отступы */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Радиусы */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
}

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

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 20%, rgba(155, 77, 255, 0.08) 0%, transparent 60%), 
               radial-gradient(circle at 70% 80%, rgba(255, 68, 180, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

.inline-link {
  position: relative;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--primary-color-light);
}

.inline-link:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.about-me a:not(.button) {
  background-image: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease;
  padding-bottom: 2px;
}

.about-me a:not(.button):hover {
  background-size: 100% 2px;
}

/* Навигация */
.navbar {
  background: rgba(15, 14, 25, 0.85);
  backdrop-filter: blur(15px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
}

.branding {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.branding img {
  height: 38px;
  width: auto;
  transition: transform 0.3s ease;
}

.branding:hover img {
  transform: scale(1.05);
}

.branding h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.branding p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
  opacity: 0.8;
}

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

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: all 0.3s ease;
  padding: 0.5rem 0.8rem;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.nav-links a::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
  left: 0;
  bottom: 0;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
  background-color: rgba(155, 77, 255, 0.05);
}

.nav-links a:hover::before,
.nav-links a.active::before {
  transform: scaleX(1);
  transform-origin: left;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
  z-index: 1001; /* Выше nav-links */
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--primary-color);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background-color: var(--accent-color);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  background-color: var(--accent-color);
}

/* Главный контент */
main {
  flex: 1;
  padding: var(--spacing-lg);
  max-width: 1200px;
  width: 100%;
  margin: 80px auto 0;
}

/* Блок героя */
.hero {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 15px 40px var(--shadow-color);
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(155, 77, 255, 0.15) 0%, transparent 60%);
  z-index: -1;
  animation: rotate 30s linear infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle at center, rgba(255, 68, 180, 0.12) 0%, transparent 60%);
  z-index: -1;
  border-radius: 50%;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero h2 {
  font-size: 2.5rem;
  margin: 0 0 var(--spacing-md);
  font-weight: 700;
  color: #ffffff;
}

.hero h2 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: #b0b4b8;
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
  line-height: 1.8;
}

/* Кнопка */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  background: var(--primary-gradient);
  color: #ffffff;
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px var(--shadow-color);
  position: relative;
  z-index: 5;
  align-self: center;
  margin-top: auto;
  border: none;
  cursor: pointer;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient-hover);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.button:hover {
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(101, 73, 240, 0.4);
}

.button:hover::before {
  opacity: 1;
}

.button span {
  position: relative;
  z-index: 1;
}

.button-accent {
  background: var(--accent-gradient);
}

.button-accent:hover {
  box-shadow: 0 10px 25px rgba(255, 68, 180, 0.4);
}

.button-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  box-shadow: none;
}

.button-outline:hover {
  background: rgba(155, 77, 255, 0.1);
  box-shadow: 0 6px 15px rgba(101, 73, 240, 0.2);
}

/* Секция проектов */
.sites {
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.sites h2 {
  font-size: 2.2rem;
  margin-bottom: var(--spacing-lg);
  font-weight: 700;
  color: #ffffff;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-lg);
}

.site-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 1;
}

.site-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}

.site-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px var(--shadow-color);
  border-color: rgba(155, 77, 255, 0.3);
}

.site-card:hover::before {
  transform: scaleX(1);
}

.site-card img {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-card h3 {
  font-size: 1.5rem;
  margin: 0 0 var(--spacing-sm);
  color: #ffffff;
  font-weight: 600;
}

.site-card p {
  font-size: 1rem;
  color: #b0b4b8;
  margin: 0 0 var(--spacing-md);
  line-height: 1.6;
  flex-grow: 1;
}

/* О компании */
.about-section {
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.about-content {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 10px 30px var(--shadow-color);
  margin-top: var(--spacing-md);
  border: 1px solid var(--border-color);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.about-content::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle at center, rgba(155, 77, 255, 0.1) 0%, transparent 70%);
  z-index: -1;
  border-radius: 50%;
}

.about-content p {
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* Навыки */
.skills-section {
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.skill-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-lg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.skill-card::before {
  content: '';
  position: absolute;
  left: -50px;
  top: -50px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 68, 180, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.skill-card h3 {
  font-size: 1.4rem;
  margin: 0 0 var(--spacing-sm);
  color: #ffffff;
  font-weight: 600;
}

.skill-card p {
  font-size: 1rem;
  color: #b0b4b8;
  margin: 0;
  line-height: 1.6;
}

/* Контакты */
.contact-section {
  padding: var(--spacing-xl) 0;
  text-align: center;
  background: linear-gradient(to bottom right, var(--bg-card), rgba(20, 15, 35, 0.9));
  border-radius: var(--border-radius-xl);
  margin: var(--spacing-xl) 0;
  box-shadow: 0 15px 40px var(--shadow-color);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle at center, rgba(155, 77, 255, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.contact-section h2 {
  font-size: 2.2rem;
  margin-bottom: var(--spacing-md);
  font-weight: 700;
  color: #ffffff;
}

.contact-section p {
  font-size: 1.1rem;
  color: #b0b4b8;
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
  line-height: 1.7;
}

.contact-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* Подвал */
.footer {
  background: rgba(15, 14, 25, 0.9);
  text-align: center;
  padding: var(--spacing-lg);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--primary-gradient);
  opacity: 0.3;
}

.footer p {
  margin: 0;
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-on-scroll {
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animate {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Адаптивность */
@media (max-width: 768px) {
  .navbar-content {
    padding: var(--spacing-md);
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 280px;
    background: rgba(15, 14, 25, 0.95);
    backdrop-filter: blur(15px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    pointer-events: auto;
    border-left: 1px solid var(--border-color);
  }

  .nav-links.active {
    right: 0;
    pointer-events: auto;
  }

  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999; /* Ниже nav-links */
    pointer-events: none;
  }

  .menu-overlay.active {
    display: block;
    pointer-events: auto;
  }

  .hero {
    padding: var(--spacing-lg);
  }

  .hero h2 {
    font-size: 2rem;
  }

  .sites-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-buttons {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .branding h1 {
    font-size: 1.4rem;
  }
  
  .hero h2 {
    font-size: 1.8rem;
  }
  
  .button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}
