/* ==========================================================================
   DESIGN SYSTEM: PREMIUM DARK BLUE-BLACK THEME
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-color: #030712;      /* Глубокий черный с синим отливом */
  --bg-card: #0f172a;       /* Темный сине-серый (Slate Blue) */
  --bg-card-hover: #1e293b; /* Более светлый сине-серый для наведения */
  --border-color: rgba(51, 65, 85, 0.5); /* Приглушенный сине-серый контур */
  --border-focus: #3b82f6;  /* Яркий чистый синий для фокуса */
  
  --text-primary: #f8fafc;  /* Практически белый */
  --text-secondary: #94a3b8;/* Серый с синим оттенком */
  --text-muted: #475569;    /* Темно-серый */
  
  /* Classic Clean Blues (No Neon Glows) */
  --primary: #2563eb;       /* Классический королевский синий */
  --secondary: #1d4ed8;     /* Глубокий синий */
  
  /* Soft Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 45px rgba(0, 0, 0, 0.6);
  
  /* Rounded Corners */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 30px;
  
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  
  --transition: all 0.25s ease;
}

/* ==========================================================================
   BASE & RESET STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hide soft glow backgrounds */
.glow-bg {
  display: none !important;
}

/* ==========================================================================
   PREMIUM CARDS
   ========================================================================== */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.logo-accent {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 48px; /* Расстояние между кнопками увеличено */
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1.05rem; /* Кнопки стали больше */
  position: relative;
  padding: 8px 16px; /* Добавлены отступы для объема */
  border-radius: var(--radius-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(37, 99, 235, 0.08); /* Мягкая темно-синяя подсветка фона */
  transform: translateY(-3px); /* Анимация сдвига вверх при наведении */
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 70%; /* Линия плавно расширяется из центра наружу */
}

.header-actions {
  display: flex;
  align-items: center;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 10px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn:hover .btn-icon {
  transform: translateX(4px);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 160px 0 80px 0;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

#wave-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.badge-new {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 36px;
  max-width: 650px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
}

/* ==========================================================================
   SECTION COMMON ELEMENTS
   ========================================================================== */
section {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 0 auto 20px auto;
  border-radius: var(--radius-sm);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   ABOUT SECTION (ОБО МНЕ)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.about-card {
  padding: 40px 30px;
  text-align: center;
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 24px auto;
  border: 1px solid rgba(37, 99, 235, 0.15);
  transition: var(--transition);
}

.about-card:hover .card-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.about-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================================================
   PROJECTS SECTION (МОИ РАБОТЫ)
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-img-wrapper {
  width: 100%;
  height: 230px;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

.project-details {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px !important; /* Теги скругленные */
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.project-link {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  gap: 8px;
  width: fit-content;
}

.project-link:hover {
  color: var(--text-primary);
}

.project-link i {
  font-size: 0.8rem;
  transition: var(--transition);
}

.project-link:hover i {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   SKILLS SECTION
   ========================================================================== */
.skills-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.skill-category-card {
  padding: 35px;
}

.skill-category-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-item {
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: default;
}

.skill-item:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  transform: translateY(-2px);
}

/* ==========================================================================
   CONTACT SECTION (СВЯЗЬ СО МНОЙ)
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
}

.contact-info {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info h3 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.detail-item i {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md) !important; /* Скругление */
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.detail-item div span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.detail-item div p {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-item div p a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.detail-item div p a:hover {
  color: var(--primary);
}

.contact-form-wrapper {
  padding: 40px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm) !important; /* Скругление */
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.04);
}

.form-status {
  padding: 12px;
  border-radius: var(--radius-sm) !important;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  display: none;
}

.form-status.success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  display: block;
}

.form-status.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  display: block;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  background: #02040a;
}

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

.copyright {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  color: var(--text-secondary);
  font-size: 1.3rem;
  transition: var(--transition);
}

.footer-socials a:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   LOADER & LOAD SPINNER
   ========================================================================== */
.loader-wrapper {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary);
  border-radius: 50% !important; /* Круглый спиннер */
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 992px) {
  .hero-text {
    margin-left: auto;
    margin-right: auto;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .skills-wrapper {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero-title {
    font-size: 2.8rem;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: 2rem;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 1.2rem;
  }
  
  .nav-link::after {
    display: none; /* Hide bottom line indicator on mobile menu */
  }

  section {
    padding: 60px 0;
  }

  .hero-section {
    padding: 120px 0 60px 0;
    min-height: auto;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
    padding: 14px 24px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem !important;
    letter-spacing: -0.5px;
  }
  .hero-subtitle {
    font-size: 1.15rem !important;
    margin-bottom: 20px;
  }
  .hero-text {
    font-size: 1rem;
    margin-bottom: 28px;
  }
}

/* Scroll Reveal Fade-in Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1), transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* 3D Tilt Card overrides to prevent CSS transform conflicts */
.about-card, .project-card, .skill-category-card, .contact-link-card {
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease-out !important;
  transform-style: preserve-3d;
}

.about-card:hover, .project-card:hover, .skill-category-card:hover, .contact-link-card:hover {
  transform: none; /* JS handles dynamic inline transform */
}

/* Contact Link Cards Layout */
.contact-links-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 100%;
}

.contact-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px 30px;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
}

.contact-link-card:hover i {
  transform: scale(1.15) translateZ(15px);
  color: var(--border-focus);
}

.contact-link-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.contact-link-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 20px 0;
  transform: translateZ(15px);
}

.contact-link-card i {
  font-size: 2.8rem;
  color: var(--primary);
  margin-bottom: 22px;
  transition: var(--transition);
  transform: translateZ(15px);
}

.contact-link-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 12px;
  font-weight: 700;
  transform: translateZ(15px);
}

.contact-btn {
  margin-top: auto;
  padding: 10px 24px;
  font-size: 0.9rem;
  border-radius: var(--radius-lg) !important;
  pointer-events: none;
  transform: translateZ(25px);
  transition: var(--transition);
}

.contact-link-card:hover .contact-btn {
  background: var(--primary-hover);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.45);
}

/* Responsive adjustment for contact cards */
@media (max-width: 768px) {
  .contact-links-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
