/* ===============
   ОБЩИЕ СТИЛИ
   =============== */

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #1a002b;
  font-family: 'Arial', sans-serif;
  color: white;
}

/* ===============
   ИНТРО
   =============== */

.intro {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
}

.intro h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.intro p {
  font-size: 1.2em;
  margin: 15px 0;
  line-height: 1.6;
  max-width: 400px;
}

.ribbon {
  margin-top: 30px;
  padding: 10px 20px;
  background: linear-gradient(45deg, #ff00cc, #3333ff);
  color: white;
  border-radius: 25px;
  cursor: pointer;
  user-select: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===============
   СТРАНИЦЫ ИСТОРИЙ
   =============== */
/* Общий контейнер */
.story-page {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh; /* заменяем 100vh на JS-переменную можно потом */
  padding: 20px;
  box-sizing: border-box;
}

/* Сетка карточек */
.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: 100%;
  max-width: 500px;
}

/* Карточка Polaroid */
.photo-card {
  position: relative;
  width: 120px;             /* фиксированная ширина */
  display: inline-block;
  text-align: center;
  margin: 10px;
  transform: rotate(calc(-3deg + 6deg * var(--i))); /* случайный наклон через CSS-переменную */
}

/* Белый фон под фото */
.photo-card .card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 25px;             /* оставляем место для подписи */
  background: white;
  border-radius: 8px;
  z-index: 0;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Фото поверх фона */
.photo-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: 5px;
  display: block;
}

/* Подпись */
.photo-card .caption {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-size: 12px;
  color: #000;
  font-weight: bold;
}

/* Индикатор свайпа */
.swipe-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  text-align: center;
  color: rgba(0,0,0,0.6);
}

/* ===============
   ИНДИКАТОР СВАЙПА
   =============== */

.swipe-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
}

.swipe-indicator span {
  display: block;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  margin: 3px auto;
  animation: pulse 1.5s infinite;
}

/* ===============
   АНИМАЦИИ
   =============== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 1s ease-in;
}

/* Плавное появление карточек */
.photo-card {
  opacity: 0;
  animation: fadeIn 0.8s ease-in forwards;
}

.photo-card:nth-child(1) { animation-delay: 0.2s; }
.photo-card:nth-child(2) { animation-delay: 0.4s; }
.photo-card:nth-child(3) { animation-delay: 0.6s; }