@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1b0034, #3a0066, #0c001a);
  background-size: 300% 300%;
  animation: pulseBackground 20s ease infinite;
  color: white;
  text-align: center;
  overflow-x: hidden;
}

canvas#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  transition: opacity 0.5s ease;
}

header {
  padding: 60px 20px 20px;
  animation: fadeIn 1s ease forwards;
}

header h1 {
  font-size: 3em;
  background: linear-gradient(90deg, #a855f7, #6b21a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

header p {
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6em;
  font-size: 1.1em;
  color: #ddd;
  animation: fadeIn 1.5s ease forwards;
}

section {
  padding: 60px 20px;
  animation: fadeIn 2s ease forwards;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 40px auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.3);
}

.video-container img {
  width: 100%;
  height: auto;
  display: block;
}

.cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 40px;
  position: relative;
}

/* Карточки с мягким пульсирующим светом */
.card {
  display: block;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 30px;
  width: 260px;
  text-align: center;
  transition: all 0.3s ease;
  animation: fadeIn 2.2s ease forwards, pulseGlow 6s ease-in-out infinite, colorGlow 8s ease-in-out infinite;
  transform: scale(1);
  text-decoration: none;
  color: white;
  cursor: pointer;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.2), 0 0 16px rgba(168, 85, 247, 0.08); }
  50% { box-shadow: 0 0 12px rgba(168, 85, 247, 0.3), 0 0 24px rgba(168, 85, 247, 0.12); }
  100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.2), 0 0 16px rgba(168, 85, 247, 0.08); }
}

@keyframes colorGlow {
  0% { box-shadow: 0 0 10px #a855f7, 0 0 20px #f472b6; }
  50% { box-shadow: 0 0 14px #f472b6, 0 0 28px #a855f7; }
  100% { box-shadow: 0 0 10px #a855f7, 0 0 20px #f472b6; }
}

.card:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.5), 0 0 50px rgba(168, 85, 247, 0.15);
}

.card a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1.3em;
}

.card p {
  margin-top: 10px;
  color: #bbb;
  font-size: 0.95em;
}

.footer {
  margin-top: 60px;
  padding: 30px;
  font-size: 0.9em;
  color: #999;
}

/* Пасхалка-звезда */
#easterStar {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 2px;
  height: 2px;
  background: radial-gradient(circle, #0f1344, #3f1e78);
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 0 4px #facc15;
  transition: transform 0.2s ease;
}

#easterStar:hover {
  transform: scale(1.3);
  box-shadow: 0 0 2px #facc15, 0 0 10px #f97316;
}

#animePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
  max-width: 80%;
  max-height: 80%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
}

#animePopup img {
  width: 100%;
  height: auto;
  display: block;
}

.back-home {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: #3b0066; /* тёмно-фиолетовая кнопка */
  color: #fff;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(59, 0, 102, 0.5);
  transition: all 0.25s ease;
  z-index: 1000;
}

.back-home:hover {
  background-color: #5a0099; /* чуть светлее при наведении */
  box-shadow: 0 0 20px rgba(90, 0, 153, 0.7);
  transform: translateY(-2px);
}

.back-home img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.photo-group h2 {
  font-size: 1.8em;
  margin-top: 40px;
  color: #a855f7;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.photo-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow: hidden;
  width: 220px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-card img {
  width: 100%;
  display: block;
}

.photo-card p {
  margin: 10px;
  color: #ccc;
  font-size: 0.95em;
}

.photo-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

/* Галерея фото */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.photo-grid img {
  width: 100%;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.photo-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255,255,255,0.3);
}

/* Папки */
.folders {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.folder {
  flex: 1 1 160px;
  background: rgba(255,255,255,0.08);
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.folder:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

/* Модалка */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.modal img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
}

.close {
  position: absolute;
  top: 15px; right: 25px;
  font-size: 2em;
  color: white;
  cursor: pointer;
}

.photo-info-toggle {
  position: absolute;
  top: 50%;
  right: 40px;
  font-size: 2em;
  color: white;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.photo-info {
  display: none;
  position: absolute;
  top: 10%;
  right: 5%;
  width: 250px;
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 10px;
  color: white;
  font-size: 0.9em;
  backdrop-filter: blur(6px);
}

.photo-folder {
  background: rgba(255, 255, 255, 0.08);
  padding: 14px 20px;
  border-radius: 10px;
  margin: 20px auto;
  width: fit-content;
  color: #fff;
  font-weight: 600;
  font-size: 1.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

.photo-folder:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: scale(1.05);
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
  overflow: hidden;
  transition: max-height 0.6s ease;
  max-height: 0;
}

.gallery.open {
  max-height: 1000px; /* временно — подставляется динамически из JS */
}






.photo-gallery {
  padding: 80px 20px;
}

.photo-gallery h1 {
  font-size: 2.2em;
  margin-bottom: 40px;
  color: #a855f7;
}

.best-photos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.photo-groups {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 40px;
}

.photo-group {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 28px;
  border-radius: 12px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.photo-group:hover {
  background: rgba(168, 85, 247, 0.2);
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* ---------- МОДАЛЬНОЕ ОКНО ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 20;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(10, 0, 20, 0.9);
  backdrop-filter: blur(6px);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 80%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #a855f7;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.arrow:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.arrow.left { left: 40px; }
.arrow.right { right: 40px; }

.arrow img {
  width: 24px;
  height: 24px;
}

/* ---------- Инфо ---------- */
.info-toggle {
  position: absolute;
  bottom: 40px;
  right: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.info-toggle:hover {
  background: rgba(168, 85, 247, 0.3);
}

.info-toggle img {
  width: 22px;
  height: 22px;
}

.photo-info {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: rgba(20, 0, 40, 0.95);
  color: #fff;
  padding: 30px;
  transform: translateX(100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.photo-info.active {
  transform: translateX(0);
}

/* ======================= */
/* ГОРИЗОНТАЛЬНАЯ ГАЛЕРЕЯ */
/* ======================= */
.gallery-scroll-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0;
  margin: 20px 0;
}

.gallery-scroll {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  min-width: min-content;
}

.gallery-scroll::-webkit-scrollbar {
  height: 8px;
}

.gallery-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.6);
  border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.8);
}

.photo-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  width: 280px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.photo-card p {
  margin: 15px;
  color: #ccc;
  font-size: 0.95em;
  text-align: center;
}

.photo-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
}

/* ======================= */
/* ЛУЧШИЕ ФОТО */
/* ======================= */
.best-photos-scroll {
  display: flex;
  gap: 25px;
  padding: 20px;
  overflow-x: auto;
}

.best-photo-card {
  position: relative;
  width: 320px;
  height: 240px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  transition: all 0.3s ease;
}

.best-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.best-photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 20px;
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.best-photo-card:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

.best-photo-card:hover .best-photo-overlay {
  transform: translateY(0);
}

/* ======================= */
/* АДАПТИВНОСТЬ */
/* ======================= */
@media (max-width: 768px) {
  .gallery-scroll {
    gap: 15px;
    padding: 0 15px;
  }
  
  .photo-card {
    width: 240px;
  }
  
  .photo-card img {
    height: 160px;
  }
  
  .best-photo-card {
    width: 280px;
    height: 200px;
  }
  
  .arrow {
    padding: 10px;
  }
  
  .arrow.left {
    left: 20px;
  }
  
  .arrow.right {
    right: 20px;
  }
  
  .info-toggle {
    bottom: 20px;
    right: 20px;
  }
}

/* ======================= */
/* АНИМАЦИИ */
/* ======================= */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.gallery.open {
  animation: slideInFromRight 0.5s ease-out;
}
