/* ------------------ Базовая стилизация (Desktop) ------------------ */
body {
  margin: 0;
  font-family: sans-serif;
  color: #eee;
  background: #1a1a1a;
  overflow-x: hidden;
}

canvas#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  z-index: -1;
}

section {
  padding: 60px 20px;
  text-align: center;
}

h1, h2 {
  color: #b19cd9;
}

#about {

  padding: 300px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.project-section {
  background: rgba(45, 45, 58, 0.7);
  width: 100%;
  padding: 60px 40px;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-radius: 30px;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}

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

.scroll-gallery {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding: 20px 0;
  scroll-behavior: smooth;
}

.scroll-gallery img {
  height: 400px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #222;
  cursor: pointer;
  transition: transform 0.2s;
}

.scroll-gallery img:hover {
  transform: scale(1.05);
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
#lightbox.hidden {
  display: none;
}
#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

.project-spacer {
  height: 80px;
  background: rgba(26, 26, 26, 0.8);
}

#footer {
  background: rgba(26, 26, 26, 0.9);
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

#footer a {
  color: #b19cd9;
  text-decoration: none;
}
#footer a:hover {
  text-decoration: underline;
}

/* About */
.about-container::before {
  content: "Gorelova PH";
  position: absolute;
  top: -80%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  font-weight: 900;
  color: rgba(177, 156, 217, 0.05);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
}

.about-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 40px auto;
  max-width: 500px;
}

.about-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #b19cd9;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.about-bubble {
  position: absolute;
  background: transparent;
  color: #eee;
  padding: 18px 28px;
  border-radius: 8px;
  max-width: 280px;
  font-size: 16px;
  line-height: 1.6;
  backdrop-filter: blur(3px);
  text-align: center;
  transition: all 0.4s ease;
  z-index: 1;
}

.about-bubble::before,
.about-bubble::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(177, 156, 217, 0.6);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.about-bubble::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.about-bubble::after { bottom: 0; right: 0; border-left: none; border-top: none; }

.about-bubble:hover::before,
.about-bubble:hover::after { width: 100%; height: 100%; border: 2px solid #b19cd9; }
.about-bubble:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(208, 139, 224, 0.4); }

/* Расположение на десктопе */
.top-left {
  top: -150px;
  left: -240px;
  transform: translate(0, 0); /* исходный transform */
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.top-left:hover {
  transform: translate(0, 0) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}

.top-right {
  top: -150px;
  right: -240px;
  transform: translate(0, 0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.top-right:hover {
  transform: translate(0, 0) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}

.bottom-center {
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bottom-center:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 0 20px rgba(208, 139, 224, 0.4);
}



/* ------------------ Адаптация для мобильных ------------------ */
@media (max-width: 768px) {
  #about {
    padding: 100px 20px; /* уменьшили padding сверху/снизу */
  }

  .about-container {
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    margin: 20px auto;
  }

  .about-bubble {
    position: static; /* убираем absolute */
    margin-top: 15px;
    max-width: 100%;
    font-size: 15px;
    text-align: center;
    backdrop-filter: blur(2px);
  }

  .about-bubble::before,
  .about-bubble::after {
    display: none; /* убираем углы */
  }

  .project-section {
    padding: 40px 20px; /* меньше отступы на мобилках */
    margin: 20px 0;
  }

  .scroll-gallery img {
    height: 200px; /* уменьшаем размер картинок на мобилках */
  }

  #bgCanvas {
    height: 30vh; /* canvas меньше на мобилках */
  }
}
/* --- Универсальная мобильная адаптация --- */
@media (max-width: 768px) {
  body, html {
    overflow-x: hidden; /* убираем горизонтальный скролл */
  }

  #about {
    padding: 100px 10px; /* уменьшили и подровняли */
  }

  .about-container {
    max-width: 100%; /* не больше ширины экрана */
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 10px; /* чтобы не было выхода за экран */
    box-sizing: border-box;
  }

  .about-bubble {
    position: static;
    margin: 10px auto; /* центрируем */
    max-width: 100%;
    text-align: center;
    left: auto; right: auto; /* убираем отрицательные смещения */
    transform: none;
  }

  #bgCanvas {
    width: 100vw;
    height: 30vh;
  }

  .project-section {
    padding: 40px 10px;
    margin: 20px 0;
  }

  .scroll-gallery img {
    height: 180px;
  }
}


.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-card .overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 10px 0;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 1px;
  transition: background 0.3s ease;
}




/* === Категории на главной странице === */
#categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  margin: 60px auto;
  max-width: 1400px;
}

.category-card {
  position: relative;
  width: 1820px;
  height: 440px;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}



.category-card .overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #b19cd9;
  font-size: 1.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  opacity: 0.9;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}



/* Мобильная адаптация */
@media (max-width: 768px) {
  .categories {
    padding: 60px 20px;
    gap: 20px;
  }
  .category-overlay h2 {
    font-size: 1.6rem;
  }
}
.category-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  border: 3px solid rgba(177, 156, 217, 0.5);
  transition: all 0.4s ease;
  background: rgba(177, 156, 217, 0.1); /* добавили лёгкую лиловую подложку */
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) brightness(0.8); /* чуть светлее */
  opacity: 0.3; /* заметная полупрозрачность */
  transition: all 0.5s ease;
}

.category-card:hover img {
  filter: grayscale(0%) brightness(1);
  opacity: 1; /* при наведении становится полностью видимой */
  transform: scale(1.05);
}
.category-card:hover {
  border-color: #b19cd9; /* яркая лиловая рамка при наведении */
  box-shadow: 0 0 35px rgba(177, 156, 217, 0.4);
}
.section-title {
  text-align: center;
  color: #b19cd9;
  font-size: 3rem;
  font-weight: 700;
  margin: 80px 0 40px 0;
  letter-spacing: 3px;
  text-transform: uppercase;

  animation: fadeIn 1.2s ease;
}

/* Чтобы плавно появлялась при загрузке */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}