/* СБРОС */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #000;
  /* Фон по умолчанию — чёрный, для ретро-стиля */
  color: #fff;
  font-family: 'Press Start 2P', monospace;
}

/* Контейнер для секций */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.retro-paragraph {
  font-family: 'VT323', monospace;
  /* шрифт для больших текстов */
  font-size: 1.5rem;
  /* чуть крупнее, чем 0.8 */
  line-height: 1;
  /* больше межстрочный интервал */
  color: #ccc;
  /* мягкий белый (пример) */
  text-align: justify;
  /* выравнивание по ширине (если нужно) */
  /* Можно добавить padding/margin, если хотите */
}

/* АНИМИРОВАННЫЙ ФОН: ЗВЁЗДНОЕ ПОЛЕ */
#starfield,
#starfield2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  /* чтобы не мешало кликам */
  z-index: 0;
}

#starfield::before,
#starfield2::before {
  content: '';
  position: absolute;
  width: 2000px;
  height: 2000px;
  /* Асимметричный и полупрозрачный градиент */
  background: radial-gradient(rgba(255, 255, 255, 0.045) 10%, rgba(255, 255, 255, 0) 80%);
  /*background: radial-gradient(ellipse at 45% 50%, rgba(255, 255, 255, 0.15) 10%, rgba(255, 255, 255, 0) 80%);*/
  animation: star-animation 10s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Второй слой крутится дольше и чуть прозрачнее */
#starfield2::before {
  animation-duration: 20s;
  opacity: 0.5;
}

@keyframes star-animation {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.05);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg) scale(1);
  }
}

.social-links a {
  display: inline-block;
  margin: 10px;
  padding: 10px 20px;
  background: #0ff;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.social-links a:hover {
  background: #ff00ff;
  color: #fff;
}


/* ===== ПОЛОСКА МАТРИЦЫ (с фиолетовым цветом и плавным «хвостиком») ===== */
.matrix-line {
  position: fixed;
  top: -150px;
  /* Начинаем за верхним краем экрана */
  color: rgba(255, 0, 255, 0.765);
  /* Фиолетовый цвет символов */
  font-size: 1rem;
  /* Размер шрифта */
  line-height: 1.2;
  /* Вертикальное расстояние между символами */
  writing-mode: vertical-rl;
  /* Пишем символы сверху вниз */
  pointer-events: none;
  z-index: 99999;
  opacity: 1;

  /* Анимация падения (сверху вниз) + плавное исчезновение (opacity: 0) */
  animation: matrixLineFall 2.5s linear forwards;

  /* МАСКА, чтобы именно верхняя часть была «прозрачной» */
  /* (Синтаксис для современных браузеров + -webkit- для Safari) */
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      /* чёрный => "невидимо" в маске */
      rgba(255, 255, 255, 1) 30%,
      /* к 30% плавный переход к белому => "видимо" */
      rgba(255, 255, 255, 1) 100%);
  mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(255, 255, 255, 1) 30%,
      rgba(255, 255, 255, 1) 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Анимация падения + исчезновения */
@keyframes matrixLineFall {
  0% {
    top: -150px;
    /* Начинаем за верхним краем */
    opacity: 1;
  }

  100% {
    top: 110%;
    /* Уходим за нижний край экрана */
    opacity: 0;
    /* Исчезаем полностью */
  }
}

/* ШАПКА */
header {
  position: fixed;
  width: 100%;
  background: #111;
  z-index: 9999;
  top: 0;
  left: 0;
  box-shadow: 0 0 10px #ff00ff;
}

header nav.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.logo {
  position: relative;
  font-size: 1.2rem;
  color: #0ff;
  cursor: default;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #0ff;
}

/* --- Бургер-кнопка --- */
.burger {
  width: 30px;
  height: 20px;
  display: none;
  /* скрываем на десктопе, покажем на мобильном */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: 0.3s;
}

.burger span {
  display: block;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}

/* Состояние .open (когда бургер превращается в "крестик") */
.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Навигация (десктоп) --- */
nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  text-decoration: none;
  color: #fff;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #0ff;
}

/* --- Адаптивное поведение (мобильные экраны) --- */
@media (max-width: 768px) {

  /* Показываем бургер */
  .burger {
    display: flex;
  }

  /* Прячем старую горизонтальную навигацию */
  nav ul {
    display: none;
    /* скрываем на мобильных, вместо этого используем выезжающее меню */
  }

  /* Мобильное меню (выезжающий блок) */
  #navMenu {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: #111;
    transform: translateX(100%);
    /* скрыто за правым краем */
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    /* изначально прозрачное */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
  }

  /* Когда меню активно */
  #navMenu.active {
    transform: translateX(0);
    opacity: 1;
  }

  /* Стили списка в мобильном меню */
  #navMenu ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  #navMenu ul li a {
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
  }

  #navMenu ul li a:hover {
    color: #0ff;
  }
}

/* ГЛИЧ-ЭФФЕКТ ДЛЯ ЛОГОТИПА */
.glitch {
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  clip: rect(0, 900px, 0, 0);
}

.glitch::before {
  animation: glitch-top 2s infinite linear alternate-reverse;
  color: #ff00ff;
}

.glitch::after {
  animation: glitch-bottom 2s infinite linear alternate-reverse;
  color: #0ff;
}

@keyframes glitch-top {
  0% {
    clip: rect(86px, 9999px, 90px, 0);
    transform: translate(-2px, -2px);
  }

  20% {
    clip: rect(30px, 9999px, 60px, 0);
    transform: translate(2px, 2px);
  }

  40% {
    clip: rect(10px, 9999px, 80px, 0);
    transform: translate(-2px, -1px);
  }

  60% {
    clip: rect(50px, 9999px, 90px, 0);
    transform: translate(2px, 0);
  }

  80% {
    clip: rect(70px, 9999px, 100px, 0);
    transform: translate(-1px, 2px);
  }

  100% {
    clip: rect(20px, 9999px, 60px, 0);
    transform: translate(0, 0);
  }
}

@keyframes glitch-bottom {
  0% {
    clip: rect(10px, 9999px, 70px, 0);
    transform: translate(2px, 0);
  }

  20% {
    clip: rect(40px, 9999px, 80px, 0);
    transform: translate(-2px, 2px);
  }

  40% {
    clip: rect(20px, 9999px, 90px, 0);
    transform: translate(1px, -1px);
  }

  60% {
    clip: rect(60px, 9999px, 100px, 0);
    transform: translate(-1px, 2px);
  }

  80% {
    clip: rect(80px, 9999px, 90px, 0);
    transform: translateY(-1px);
  }

  100% {
    clip: rect(30px, 9999px, 60px, 0);
    transform: translate(0, 0);
  }
}

/* Герой-секция */
#hero {
  position: relative;
  height: 100vh;
  /* на всю высоту экрана */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  padding-top: 60px;
  /* чтобы контент не прятался под шапку */
  overflow: hidden;
  /* скрываем то, что выходит за пределы (город) */
  background: #000;
  /* или звёздный фон, градиент, и т.д. */
}

/* Контент (тайпрайтер, subtitle, кнопка) */
.hero-content {
  max-width: 800px;
  margin: 0 auto;
  margin-bottom: 10%;
  position: relative;
  /* чтобы z-index работал */
  z-index: 10;
  /* поверх слоёв города */
}

/* Текст анимации печатной машинки */
.typewriter {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #ff00ff;
}

/* Подзаголовок */
.subtitle {
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 30px;
}

/* Кнопка "PRESS START" */
.btn-press-start {
  display: inline-block;
  padding: 15px 30px;
  background: #0ff;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
  font-size: 0.8rem;
}

.btn-press-start:hover {
  background: #ff00ff;
  color: #fff;
}

/* Контейнер для многослойного города */
/* Контейнер для многослойного города */
/* Контейнер для многослойного города */
.city-layers {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* можно без overflow, т.к. #hero уже hidden */
}

/* Каждый слой PNG */
.city-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  /* чтобы клики проходили сквозь */
}


/* (Опционально) задать разный z-index для каждого слоя, 
   если нужны перекрытия:*/
#layer0 {
  height: 100vh;
  z-index: 0;

}

#layer1 {
  z-index: 1;
}

#layer2 {
  z-index: 2;

}

#layer3 {
  z-index: 3;

}

#layer4 {
  z-index: 4;

}

#layer5 {
  z-index: 5;
}

#layer6 {
  z-index: 6;
}

#layer7 {
  z-index: 7;
  opacity: 0.5;
}



/* СЕКЦИЯ "ОБО МНЕ" */
#about {
  padding-top: 100px;
  text-align: center;
}

#about h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #0ff;
}

#about p {
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 0.8rem;
}

/* Общий отступ между секциями */
.resume-section {
  padding: 30px 20px;
  /* можно варьировать */
  text-align: center;
  /* заголовок по центру, контент можно выравнивать иначе */
}

/* Заголовок секции (About, Education, etc.) */
.resume-section h2 {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #0ff;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 10px;
  display: inline-block;
}

/* Контент в About (просто абзацы) */
.resume-content p {
  max-width: 700px;
  margin: 0 auto 15px auto;
  line-height: 1.6;
  font-size: 0.8rem;
  text-align: left;
  /* или justify, если хотите */
  color: #fff;
}

/* Контейнер для «карточек» (Education, Experience) */
.resume-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  /* чтобы карточки были по центру */
}

/* Стили «карточки» */
.resume-card {
  background: #111;
  /* тёмный фон */
  border: 2px solid #0ff;
  /* неоновая рамка */
  border-radius: 8px;
  width: 100%;
  max-width: 700px;
  /* ширина карточки */
  padding: 20px;
  text-align: left;
  color: #fff;
  transition: transform 0.3s;
  position: relative;
}

/* Ховер-эффект для карточки */
.resume-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Заголовок в карточке */
.resume-card h3 {
  margin-bottom: 5px;
  font-size: 1rem;
  color: #ff00ff;
}

/* Дата/период */
.date-range {
  display: block;
  margin-bottom: 10px;
  font-size: 0.7rem;
  color: #ccc;
}

/* Текст в карточке */
.resume-card p {
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 0;
  color: #ccc;
}

/* Адаптивность */
@media (max-width: 768px) {
  .resume-section {
    padding: 40px 10px;
  }

  .resume-section h2 {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .resume-card h3 {
    font-size: 0.9rem;
  }

  .resume-card p,
  .resume-content p {
    font-size: 0.7rem;
  }
}


/* СЕКЦИЯ "ПРОЕКТЫ" */
/* Контейнер модалки (скрыт по умолчанию) */
.modal {
  display: none;
  /* изначально невидима */
  position: fixed;
  z-index: 9999;
  /* поверх всего */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  /* если контент большой, появляется скролл */
  background-color: rgba(0, 0, 0, 0.8);
  /* полупрозрачный тёмный фон */
}

/* Внутренний блок (контент модалки) */
.modal-content {
  background-color: #111;
  margin: 10% auto;
  padding: 20px;
  border: 2px solid #0ff;
  width: 90%;
  /* или 80%, если нужно */
  max-width: 700px;
  /* увеличиваем максимум */
  position: relative;
  border-radius: 8px;
  color: #fff;
}

.modal-content p {
  text-align: left;
}

/* Кнопка "×" для закрытия */
.close {
  color: #fff;
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: 10px;
}

.close:hover {
  color: #0ff;
}

/* Стили для карточек, как раньше */
#projects {
  padding: 100px 20px;
  text-align: center;
}

#projects h2 {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #0ff;
  /* или любой другой цвет */
}

/* Flex-контейнер для карточек */
.projects-flex {
  display: flex;
  flex-wrap: wrap;
  /* переносим карточки на новую строку при нехватке места */
  justify-content: center;
  /* выравниваем карточки по центру горизонтали */
  gap: 20px;
  /* расстояние между карточками */
}

/* Каждая карточка */
.project-card {
  width: 300px;
  /* фиксированная ширина (чтобы было ровно 3 в первом ряду) */
  background: #111;
  border: 2px solid #0ff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s;
}

.project-card:hover {
  transform: translateY(-5px) rotate(-1deg);
}

.project-card img {
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}

.project-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #ff00ff;
}

.project-card p {
  font-size: 0.8rem;
  color: #ccc;
}

/* СЕКЦИЯ "КОНТАКТЫ" */
#contact {
  padding: 100px 0;
  text-align: center;
}

#contact h2 {
  font-size: 1.2rem;
  margin-bottom: 40px;
  color: #0ff;
}

#contact form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#contact form input,
#contact form textarea {
  background: #111;
  border: 2px solid #ff00ff;
  color: #fff;
  padding: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  border-radius: 4px;
}

#contact form button {
  padding: 15px 30px;
  background: #ff00ff;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  cursor: pointer;
  transition: background 0.3s;
}

#contact form button:hover {
  background: #0ff;
  color: #000;
}

/* ПОДВАЛ */
footer {
  background: #111;
  padding: 20px 0;
  text-align: center;
  border-top: 2px solid #ff00ff;
}

footer p {
  font-size: 0.7rem;
  color: #fff;
  margin: 0;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
  .typewriter {
    font-size: 1.2rem;
  }

  #about,
  #projects,
  #contact {
    padding: 60px 0;
  }
}

/* ====== FIX: Accordion cards for WORK EXPERIENCE ====== */

/* карточка-аккордеон — без внешнего паддинга, фон/рамка как у тебя */
details.resume-card {
  padding: 0;
  background: #111;
  border: 2px solid #0ff;
  border-radius: 10px;
  width: 100%;
  max-width: 780px;
  /* немного шире — меньше переносов */
  margin: 16px auto;
  box-shadow: 0 0 0 2px rgba(0, 255, 255, .12) inset;
}

/* кликабельная шапка */
details.resume-card>summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 48px 16px 18px;
  /* справа место для стрелки */
  display: grid;
  grid-template-columns: 1fr auto;
  /* заголовок слева, дата справа */
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

details.resume-card>summary::-webkit-details-marker {
  display: none;
}

/* заголовок — меньше, с нормальными переносами */
details.resume-card>summary h3 {
  margin: 0;
  font-size: 0.95rem;
  /* было 1rem — чуть уменьшил */
  line-height: 1.25;
  color: #ff00ff;
  overflow-wrap: anywhere;
  /* не рвёт слова по буквам */
  word-break: normal;
  hyphens: auto;
}

/* дата справа, всегда на одной строке если можно */
details.resume-card>summary .date-range {
  margin: 0;
  font-size: 0.72rem;
  color: #ccc;
  white-space: nowrap;
}

/* стрелка справа */
details.resume-card>summary::after {
  content: "▸";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform .18s ease;
  font-size: 14px;
  color: #0ff;
}

details.resume-card[open]>summary::after {
  transform: translateY(-50%) rotate(90deg);
}

/* hover/focus состояния */
details.resume-card>summary:hover {
  background: rgba(0, 255, 255, .06);
}

details.resume-card>summary:focus {
  outline: none;
}

details.resume-card>summary:focus-visible {
  outline: 2px dashed #0ff;
  outline-offset: 3px;
}

/* тело карточки — аккуратный разделитель, фикс ломаной линии */
details.resume-card .card-body {
  padding: 14px 18px 16px 18px;
  border-top: 1px solid rgba(0, 255, 255, .18);
  /* вместо «рваной» линии */
  box-shadow: 0 -1px 0 rgba(0, 255, 255, .08) inset;
}

/* same look as project descriptions (retro-paragraph) */
details.resume-card .card-body p {
  margin: 10px 0;
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  /* как в .retro-paragraph */
  line-height: 1;
  /* тот же tight line-height */
  color: #ccc;
  /* тот же мягкий белый */
  text-align: justify;
  /* как в .retro-paragraph */
}

/* мобильная сетка: заголовок и дата в столбик */
@media (max-width: 768px) {
  details.resume-card>summary {
    grid-template-columns: 1fr;
    padding-right: 48px;
  }

  details.resume-card>summary .date-range {
    white-space: normal;
    margin-top: 6px;
  }
}

details.resume-card .card-body p,
.resume-card p,
.project-card p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  /* чуть меньше чем 1.5rem, зато аккуратно */
  line-height: 1.5;
  /* для глаз приятно */
  color: #ccc;
}