/* === Общие стили === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  background-color: #000;
  color: #fff;
  font-family: 'Fira Code', monospace;
  line-height: 1.6;
  overflow-x: hidden;
  padding: 0; /* без отступов по умолчанию на мобильных */
}

/* === Отступы на больших экранах === */
@media (min-width: 769px) {
  body {
    padding: 0 2rem; /* небольшие поля слева и справа */
  }
}

/* === Шапка и навигация === */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0; /* только вертикально */
  border-bottom: 1px solid #333;
  position: relative;
}

/* Логотип */
.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  user-select: none;
}

/* Десктоп-меню */
.desktop-nav {
  display: flex;
}

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.desktop-nav a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  user-select: none;
}

.desktop-nav a:hover {
  color: #fff;
  text-shadow: 0 0 4px #fff;
}

/* Гамбургер (скрыт на десктопе) */
.menu-toggle {
  display: none;
  width: 25px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #ccc;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Мобильное полноэкранное меню (скрыто по умолчанию) */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: #000;
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mobile-nav ul {
  list-style: none;
  text-align: center;
  padding: 0;
}

.mobile-nav li {
  margin: 1rem 0;
}

.mobile-nav a {
  color: #ccc;
  font-size: 1.5rem;
  text-decoration: none;
  transition: color 0.3s ease;
  user-select: none;
}

.mobile-nav a:hover {
  color: #fff;
}

/* === Hero === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 120px);
  text-align: center;
  padding: 2rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #aaa;
}

/* === Кнопки (.btn) === */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border: 1px solid #fff;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.btn:hover {
  background-color: #fff;
  color: #000;
}

/* === Проекты === */
.projects {
  padding: 2rem 0;
  text-align: center;
}

.project-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Карточка квадратной формы */
.project-card {
  position: relative;
  /* ширина: 90% от окна, но не более 400px */
  width: 90vw;
  max-width: 400px;
  /* гарантия квадрата */
  aspect-ratio: 1 / 1;
  border: 1px solid #fff;
  background: #111;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.project-card:hover {
  background-color: #222;
  box-shadow: 0 0 8px #fff;
}

/* Картинка растягивается на всю карточку */
.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Текстовый блок внутри карточки */
.project-content {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}

.project-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #fff;
}

.project-content p {
  margin: 0;
  font-size: 0.9rem;
  color: #ccc;
}

/* (Опционально) Немного отступов по бокам для десктопа */
@media (min-width: 769px) {
  .project-grid {
    padding: 0 2rem;
  }
}




/* === Модальное окно === */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #111;
  padding: 2rem;
  border: 1px solid #fff;
  max-width: 600px;
  width: 90%;
  position: relative;
  color: #ccc;
}

.modal-content a {
  color: #ccc;
  text-decoration: underline;
}

.modal-content a:hover {
  color: #fff;
  text-shadow: 0 0 5px #fff;
}

.close {
  position: absolute;
  top: 0.5rem; right: 1rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
}

/* === Обо мне === */
.about-page {
  padding: 2rem 0;
  max-width: 800px;
  margin: 0 auto;
}

.about-page h1,
.about-page h2 {
  margin-bottom: 1rem;
  text-align: center;
}

.about-page p {
  color: #ccc;
  margin-bottom: 2rem;
}

/* === Сертификаты — одинаковые превью === */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start;
  justify-items: center; /* выравнивание карточек по центру */
}

/* каждая карточка (контейнер) */
.cert-item {
  width: 100%;
  max-width: 300px;      /* максимальная ширина карточки — подгони под дизайн */
  box-sizing: border-box;
}

/* блок-превью с фиксированным соотношением (4:3) */
.cert-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;   /* можно изменить на 16/9 или 1/1 если нужно квадрат */
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #555;
  background: #0a0a0a;
  display: block;
}

/* сам рисунок — растягиваем и обрезаем по контейнеру */
.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* подпись/описание под превью */
.cert-item p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #aaa;
  text-align: center;
  word-wrap: break-word;
}

/* адаптивность: меньше max-width на очень узких экранах */
@media (max-width: 480px) {
  .cert-grid {
    gap: 0.75rem;
  }
  .cert-item {
    max-width: 220px;
  }
  .cert-thumb {
    aspect-ratio: 4 / 3;
  }
}


/* === Футер и рыжий кот === */
footer {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid #333;
  font-size: 0.9rem;
  color: #666;
  position: relative;
}

.footer-cat {
  width: 250px;
  opacity: 0.6;
  margin: 0.5rem auto 0;
  transition: opacity 0.3s ease;
}

.footer-cat:hover {
  opacity: 1;
}

/* === Адаптивность === */
@media (max-width: 768px) {
  /* Скрываем десктоп-меню, показываем гамбургер */
  .desktop-nav {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  /* Позиционирование гамбургера */
  .menu-toggle {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
  }
  /* Появление мобильного меню при активном классе */
  .mobile-nav.active {
    display: flex;
  }
  /* Уменьшаем кота в футере */
  .footer-cat {
    width: 200px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  .footer-cat {
    width: 150px;
  }
}

.terminal-nav-action {
  margin-top: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.terminal-link {
  padding: 0.75rem 1.5rem;
  font-family: 'Fira Code', monospace;
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.terminal-link:hover {
  background: #fff;
  color: #000;
}

.fake-terminal {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Fira Code', monospace;
  color: #0f0;
  margin-top: 1rem;
  font-size: 1rem;
}

.fake-terminal.hidden {
  display: none;
}

.prompt {
  margin-right: 0.5rem;
  color: #0f0;
}

/* === Отступы на мобильных === */
@media (max-width: 768px) {
  body {
    padding: 0 1rem;
  }
}


/* Кнопка закрытия в мобильном меню */
.mobile-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.12s ease;
  z-index: 1010; /* чуть выше мобильного меню контента */
}

.mobile-close:hover {
  color: #fff;
  transform: scale(1.05);
}

/* Скрываем по умолчанию (мобильное меню скрыто) — показывается вместе с меню */
.mobile-nav .mobile-close {
  display: none;
}

/* Когда меню активно — показываем крестик */
.mobile-nav.active .mobile-close {
  display: block;
}

/* Блокировка прокрутки при активном меню (класс добавляется к body) */
.no-scroll {
  overflow: hidden;
}

/* На больших экранах крестик не нужен (хотя .mobile-nav обычно скрыт) */
@media (min-width: 769px) {
  .mobile-close {
    display: none !important;
  }
}


/* ===== Lightbox / Modal для дипломов ===== */
.image-modal {
  position: fixed;
  inset: 0;
  display: none;               /* включается классом .open */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
  z-index: 3000;
  padding: 1.5rem;
}

.image-modal.open {
  display: flex;
}

.image-modal .modal-inner {
  max-width: 95vw;
  max-height: 95vh;
  width: min(1100px, 95%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
}

.image-modal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  transform: scale(.98);
  transition: transform 260ms cubic-bezier(.2,.9,.3,1), opacity 200ms ease;
  opacity: 0;
}

/* при открытии — плавный зум */
.image-modal.open img {
  transform: scale(1);
  opacity: 1;
}

/* Кнопка закрытия */
.image-modal .close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #111;
  border: 1px solid #666;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3100;
  transition: transform 0.12s ease, background 0.12s ease;
}

.image-modal .close-btn:hover {
  transform: scale(1.05);
  background: #222;
}

/* Подпись (alt) под изображением */
.image-modal .caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: #ccc;
  text-align: center;
}

/* Центровка и отступы на маленьких экранах */
@media (max-width: 480px) {
  .image-modal .close-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    top: 6px;
    right: 6px;
  }
  .image-modal {
    padding: 0.8rem;
  }
}


/* ---- fake console typing area ---- */
.fake-console {
  display: none; /* показывается динамически */
  background: #050505;
  color: #cfcfcf;
  font-family: 'Fira Code', monospace;
  padding: 0.6rem 1rem;
  border: 1px solid #222;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  margin: 1rem auto;
  max-width: 900px;
  width: calc(100% - 2rem);
  white-space: pre-wrap;
  overflow: hidden;
}

/* строки консоли */
.fake-console .prompt {
  color: #9fd3ff;
  margin-right: 0.4rem;
}

.fake-console .typed {
  color: #fff;
}

.fake-console .cursor {
  display: inline-block;
  width: 8px;
  background: #fff;
  margin-left: 4px;
  animation: blink 1s steps(2, start) infinite;
  vertical-align: middle;
  height: 1em;
}

@keyframes blink { 50% { opacity: 0; } }

/* секция контактов — скрытая по умолчанию */
.hidden { 
  display: none !important;
}

/* плавное появление */
.contacts-embedded {
  max-width: 900px;
  margin: 1.25rem auto;
  padding: 1rem;
  border: 1px solid #222;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  border-radius: 6px;
  color: #ddd;
  transition: opacity 260ms ease, transform 260ms ease;
  opacity: 1;
}

/* карточка контактов внутри about */
.contact-card-inline {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.contact-left {
  min-width: 220px;
  flex: 1 1 280px;
}

/* small tweaks */
.social-list-inline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
}

.social-list-inline a {
  color: #ccc;
  text-decoration: underline;
}

/* вид при показе — можно плавно анимировать */
.contacts-embedded.revealed {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Центрируем кнопку */
.contacts-trigger {
  text-align: center;
  margin: 2rem 0;
}

.contacts-btn {
  background: #222;
  color: #fff;
  padding: 0.7rem 1.5rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contacts-btn:hover {
  background: #333;
}

/* Плавное появление контактов */
#contacts-section {
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s ease;
}

#contacts-section.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 1000px; /* большое значение для раскрытия */
}

/* Ссылки без подчеркивания */
a {
  text-decoration: none;
}

/* ===== Музыкальные карточки ===== */
.music-post {
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 650px;
  margin: 1.5rem auto;
  text-align: center;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.music-post:hover {
  background: #181818;
  box-shadow: 0 0 12px rgba(255,255,255,0.08);
}

.music-cover {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 280px;              /* фиксированная компактная высота */
  margin: 0 auto 1rem auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #444;
  background: #0a0a0a;
}
.music-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;         /* сохраняет пропорции, не обрезает */
}

.music-play {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid #fff;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(3px);
}
.music-play:hover {
  background: #fff;
  color: #000;
  transform: scale(1.1);
}

.music-meta {
  margin-top: 0.5rem;
}
.music-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 0.2rem;
}
.music-date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 0.4rem;
}
.music-desc {
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

/* ===== Треклист для альбомов ===== */
.tracklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.tracklist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #222;
  padding: 0.5rem 0;
  color: #ccc;
  font-size: 0.95rem;
  transition: background 0.25s ease;
}
.tracklist li:hover {
  background: rgba(255,255,255,0.03);
}
.tracklist li.playing {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.tracklist button {
  background: transparent;
  border: 1px solid #888;
  border-radius: 50%;
  color: #ccc;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}
.tracklist button:hover {
  background: #fff;
  color: #000;
}

/* Альбомные кнопки управления под описанием */
.album-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.album-controls button {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  transition: all 0.2s ease;
}
.album-controls button:hover {
  background: #fff;
  color: #000;
}

.track-progress-container {
  margin-top: 6px;
}

.track-progress {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #333;
  cursor: pointer;
  display: block;
}

.track-progress::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin-top: -3px;
}

.track-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.track-progress::-ms-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

