/* ===== ИМПОРТ ШРИФТА ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --black: #0a0a0f;
  --dark: #111118;
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: rgba(124, 58, 237, 0.3);
  --gray: #6b7280;
  --gray-light: #9ca3af;
  --white: #f9fafb;
  --border: rgba(124, 58, 237, 0.2);
}

/* ===== СБРОС И БАЗА ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--black);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== CANVAS (ЧАСТИЦЫ) ===== */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

/* Ник с эффектом свечения */
.header__logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--purple-light), #c084fc, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 12px var(--purple-glow));
  cursor: default;
  user-select: none;
}

/* Кнопка "About Me" в хедере */
.header__btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.03em;
}

.header__btn:hover {
  border-color: var(--purple);
  color: var(--white);
  background: var(--purple-glow);
  box-shadow: 0 0 20px var(--purple-glow);
}

/* ===== ГЛАВНЫЙ КОНТЕНТ ===== */
.main {
  position: relative;
  z-index: 1;
}

/* ===== СЕКЦИЯ HERO (главная) ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 60px 60px;
  text-align: center;
}

.hero__content {
  max-width: 720px;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.8s ease forwards 0.3s;
}

/* Маленький тег над заголовком */
.hero__tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--purple-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* Фиолетовое выделение в заголовке */
.hero__title span {
  background: linear-gradient(135deg, var(--purple-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px var(--purple-glow));
}

.hero__desc {
  font-size: 1.1rem;
  color: var(--gray-light);
  margin-bottom: 48px;
  font-weight: 300;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Группа кнопок */
.hero__btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Основная кнопка (заполненная) */
.btn-primary {
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border: none;
  border-radius: 10px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Блик на кнопке */
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn-primary:hover::before {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

/* Второстепенная кнопка (outline) */
.btn-secondary {
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--gray-light);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--purple);
  color: var(--white);
  background: var(--purple-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--purple-glow);
}

/* ===== ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ ===== */

/* Свечение за заголовком */
.hero__glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

/* Полоска-разделитель */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), transparent);
  margin: 0 auto 48px;
}

/* ===== СТРАНИЦА ПРОЕКТОВ ===== */
.projects-page {
  min-height: 100vh;
  padding: 140px 60px 80px;
  position: relative;
  z-index: 1;
}

.projects-page__header {
  text-align: center;
  margin-bottom: 80px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease forwards 0.2s;
}

.projects-page__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.projects-page__title span {
  background: linear-gradient(135deg, var(--purple-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.projects-page__sub {
  color: var(--gray);
  font-size: 1rem;
}

/* Сетка проектов */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.4s;
}

/* Заглушка пустой сетки */
.projects-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 20px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--gray);
}

.projects-empty__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.projects-empty p {
  font-size: 0.95rem;
  opacity: 0.6;
}

/* Карточка проекта (для будущего) */
.project-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--purple-glow);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}

/* Показ модалки */
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px 40px;
  max-width: 460px;
  width: 100%;
  position: relative;
  transform: scale(0.85) translateY(20px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

/* Кнопка закрытия */
.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gray);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: rgba(124,58,237,0.15);
  border-color: var(--purple);
  color: var(--white);
}

.modal__title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.modal__title span {
  background: linear-gradient(135deg, var(--purple-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal__text {
  color: var(--gray-light);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Кнопки в модалке (контакты) */
.modal__btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.modal__link:hover {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.1);
  transform: translateX(4px);
}

.modal__link-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.modal__link-icon--tg {
  background: rgba(41, 182, 246, 0.15);
}

.modal__link-icon--dc {
  background: rgba(114, 137, 218, 0.15);
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--black);
}

::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 3px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
  .header {
    padding: 16px 24px;
  }

  .hero {
    padding: 100px 24px 60px;
  }

  .hero__btns {
    flex-direction: column;
    align-items: center;
  }

  .projects-page {
    padding: 120px 24px 60px;
  }

  .modal {
    padding: 40px 24px 32px;
  }
}

/*СТРАНИЦА ПРОЕКТОВ — КАРТОЧКИ*/

/* Обёртка страницы проектов */
.projects-page {
  min-height: 100vh;
  padding: 140px 60px 80px;
  position: relative;
  z-index: 1;
}

/* Шапка страницы */
.projects-page__header {
  text-align: center;
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease forwards 0.2s;
}

.projects-page__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.projects-page__title span {
  background: linear-gradient(135deg, var(--purple-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.projects-page__sub {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 32px;
}

/* ── Сетка карточек ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto 60px;
}

/* ── Карточка проекта ── */
.project-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;

  /* Начальное состояние для анимации появления */
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

/* Видимое состояние (добавляется JS при скролле) */
.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Блик в углу карточки */
.project-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent 70%);
  border-radius: 50%;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.project-card:hover::before {
  opacity: 1;
}

/* Hover-эффект карточки */
.project-card:hover {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.07);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.2),
    0 16px 48px rgba(124, 58, 237, 0.15);
  transform: translateY(-6px);
}

/* Эмодзи-иконка */
.project-card__icon {
  font-size: 2.2rem;
  line-height: 1;
}

/* Заголовок карточки */
.project-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Описание */
.project-card__desc {
  font-size: 0.9rem;
  color: var(--gray-light);
  line-height: 1.65;
  flex: 1;
}

/* Разделитель внутри карточки */
.project-card__divider {
  height: 1px;
  background: var(--border);
}

/* Кнопка внутри карточки */
.project-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
  color: var(--purple-light);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: fit-content;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-card__btn::after {
  content: '→';
  transition: transform 0.3s ease;
  display: inline-block;
}

.project-card__btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: var(--purple-light);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.project-card__btn:hover::after {
  transform: translateX(4px);
}

/* ── Кнопка "Назад" ── */
.back-btn-wrap {
  text-align: center;
  padding: 20px 0 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.6s;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--gray);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-back::before {
  content: '←';
  transition: transform 0.3s ease;
  display: inline-block;
}

.btn-back:hover {
  border-color: var(--purple);
  color: var(--white);
  background: var(--purple-glow);
  box-shadow: 0 4px 20px var(--purple-glow);
}

.btn-back:hover::before {
  transform: translateX(-4px);
}

/* СТРАНИЦА ОДНОГО ПРОЕКТА */

.project-detail {
  min-height: 100vh;
  padding: 140px 60px 80px;
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

/* Хлебная крошка */
.project-detail__crumb {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.5s ease forwards 0.1s;
}

.project-detail__crumb a {
  color: var(--purple-light);
  text-decoration: none;
  transition: color 0.2s;
}

.project-detail__crumb a:hover {
  color: var(--white);
}

/* Иконка и заголовок */
.project-detail__head {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
  margin-bottom: 32px;
}

.project-detail__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.project-detail__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.project-detail__title span {
  background: linear-gradient(135deg, var(--purple-light), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-detail__desc {
  font-size: 1.05rem;
  color: var(--gray-light);
  line-height: 1.7;
}

/* Блок "Что было сделано" */
.project-detail__block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  margin: 36px 0;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.35s;
}

.project-detail__block-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--purple-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Список работ */
.project-detail__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-detail__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--gray-light);
}

/* Маркер-точка у каждого пункта */
.project-detail__list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--purple);
}

/* Кнопки внизу страницы проекта */
.project-detail__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.5s;
}

/* АДАПТИВ */

@media (max-width: 768px) {
  .projects-page {
    padding: 110px 20px 60px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-detail {
    padding: 110px 20px 60px;
  }

  .project-detail__actions {
    flex-direction: column;
  }

  .project-detail__actions .btn-primary,
  .project-detail__actions .btn-back {
    width: 100%;
    justify-content: center;
  }
}