/* ============================================
   Регина — сайт-признание
   Mobile-first, тёплый, нежный
   ============================================ */

:root {
  /* Тёплая палитра — крем, пудра, тёплый розовый */
  --bg: #fffbf9;
  --bg-section: #fef8f5;
  --text: #2d2a26;
  --text-soft: #5c5650;
  --accent: #c4a484;
  --accent-deep: #a67c52;
  --rose: #e8c4c4;
  --rose-soft: #f5e1e1;
  --shadow: rgba(166, 124, 82, 0.15);
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Контейнер — удобные отступы для мобилы */
.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, var(--rose-soft) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(232, 196, 196, 0.3) 0%, transparent 50%);
  pointer-events: none;
}

/* Мерцающие звёзды */
.hero-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-stars .star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--rose);
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 3s ease-in-out infinite;
}

.hero-stars .star:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.hero-stars .star:nth-child(2) { top: 25%; right: 15%; animation-delay: 0.5s; }
.hero-stars .star:nth-child(3) { top: 40%; left: 5%; animation-delay: 1s; }
.hero-stars .star:nth-child(4) { top: 60%; right: 8%; animation-delay: 1.5s; }
.hero-stars .star:nth-child(5) { top: 75%; left: 20%; animation-delay: 2s; }
.hero-stars .star:nth-child(6) { top: 85%; right: 25%; animation-delay: 0.3s; }
.hero-stars .star:nth-child(7) { top: 35%; right: 30%; animation-delay: 2.5s; }
.hero-stars .star:nth-child(8) { top: 55%; left: 35%; animation-delay: 0.8s; }
.hero-stars .star:nth-child(9) { top: 20%; left: 80%; animation-delay: 1.2s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.6; transform: scale(1); }
}

/* Лёгкие сердечки в углах Hero */
.hero-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.heart-accent {
  position: absolute;
  font-size: 24px;
  color: var(--rose);
  opacity: 0.2;
  animation: heartFloat 4s ease-in-out infinite;
}

.heart-1 { top: 12%; left: 8%; animation-delay: 0s; }
.heart-2 { top: 18%; right: 10%; animation-delay: 1.3s; }
.heart-3 { bottom: 20%; left: 15%; animation-delay: 2.6s; }

@keyframes heartFloat {
  0%, 100% { opacity: 0.15; transform: translateY(0) scale(0.9); }
  50% { opacity: 0.35; transform: translateY(-8px) scale(1.1); }
}


.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-soft);
  margin-bottom: 16px;
  min-height: 1.4em;
}

.hero-greeting .cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
  transition: opacity 0.3s ease;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeInUp 1s ease forwards 1.2s;
  text-shadow: 0 0 50px rgba(232, 196, 196, 0.35);
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-soft);
  max-width: 320px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInUp 1s ease forwards 1.6s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Секции
   ============================================ */
.section {
  padding: 64px 0;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--transition), transform 0.9s var(--transition);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section.visible-up {
  opacity: 0;
  transform: translateY(-24px);
}

/* Чередование фона секций + плавные переходы */
.confess, .wishes, .reminder {
  background: var(--bg-section);
}

.dates-section, .playlist-section, .video-section {
  background: var(--bg);
}

.section {
  background-blend-mode: normal;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
  text-align: center;
  text-shadow: 0 0 40px rgba(232, 196, 196, 0.4);
}

.text-block {
  margin-bottom: 24px;
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.75;
}

.text-block:last-child {
  margin-bottom: 0;
}

.text-block.highlight {
  color: var(--accent-deep);
  font-weight: 500;
  padding: 20px;
  background: var(--rose-soft);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  box-shadow: 0 0 30px rgba(232, 196, 196, 0.3);
}

/* Я люблю тебя любой */
.love-anyway {
  margin-top: 32px;
  padding: 24px;
  background: linear-gradient(135deg, var(--rose-soft) 0%, rgba(232, 196, 196, 0.4) 100%);
  border-radius: 16px;
  border-left: 4px solid var(--accent);
  box-shadow: 0 0 30px rgba(232, 196, 196, 0.3);
}

.rotating-word {
  font-weight: 600;
  color: var(--accent-deep);
  transition: opacity 0.3s ease;
}

.rotating-word.fade-out {
  opacity: 0;
}

/* Наши даты */
.dates-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.date-item {
  padding: 24px;
  background: var(--bg-section);
  border-radius: 16px;
  border: 1px solid rgba(232, 196, 196, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.date-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--shadow);
}

.date-value {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 4px;
}

.date-phrase {
  margin-top: 12px;
  font-size: 16px;
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
}

.date-item-more .date-value {
  display: none;
}

.date-item-more .date-phrase {
  margin-top: 0;
}

/* Расстояние */
.distance-text {
  font-size: 18px;
  text-align: center;
  font-style: italic;
}

/* Плейлист */
.playlist-intro {
  font-size: 17px;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 32px;
  font-style: italic;
}

.playlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-section);
  border-radius: 14px;
  border: 1px solid rgba(232, 196, 196, 0.5);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.track-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px var(--shadow);
}

.track-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  min-width: 28px;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.track-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.track-artist {
  font-size: 14px;
  color: var(--text-soft);
}

.playlist-actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(232, 196, 196, 0.5);
  text-align: center;
}

.playlist-hint {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.playlist-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.music-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--rose);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.music-btn:hover {
  background: var(--rose-soft);
}

.music-btn.active {
  background: var(--rose);
  color: var(--text);
}

/* Медиа — фото и видео с рамками */
.media-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 0 0 1px rgba(232, 196, 196, 0.5),
    0 8px 32px rgba(166, 124, 82, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  background: var(--bg-section);
}

.media-frame::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(232, 196, 196, 0.4);
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
}

.media-frame .video-wrap,
.media-frame img {
  position: relative;
  z-index: 1;
}

.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

/* Акцентное видео */
.video-accent {
  background: var(--bg-section);
}

.media-frame-accent {
  max-width: 480px;
  margin: 0 auto 16px;
}

.media-frame-accent .media-video {
  aspect-ratio: 9 / 16;
  width: 100%;
  display: block;
  object-fit: cover;
}

.media-caption {
  text-align: center;
  font-size: 16px;
  font-style: italic;
  color: var(--text-soft);
  margin-top: 16px;
}

/* Видео-обёртка */
.video-wrap {
  position: relative;
  cursor: pointer;
}

.video-wrap video {
  display: block;
  width: 100%;
  vertical-align: middle;
  background: var(--bg-section);
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(45, 42, 38, 0.25);
  transition: opacity 0.4s ease, background 0.4s ease;
}

.video-fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 22px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.video-fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.05);
}

.video-fullscreen-btn .fullscreen-icon {
  line-height: 1;
}

.video-wrap.video-fullscreen video {
  object-fit: contain;
}

.video-error-msg {
  position: absolute;
  bottom: 16px;
  left: 12px;
  right: 12px;
  font-size: 12px;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 12px;
  border-radius: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.video-error-msg.visible {
  max-height: 120px;
  opacity: 1;
}

.video-wrap.playing .video-overlay {
  opacity: 0;
  pointer-events: none;
}

.video-play-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-play-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

.play-icon {
  font-size: 28px;
  color: var(--accent-deep);
}

.play-text {
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
  max-width: 80px;
}

.media-frame-accent .play-icon {
  font-size: 36px;
}

.media-frame-accent .play-text {
  font-size: 12px;
  max-width: 120px;
}

.media-frame-accent .video-play-btn {
  padding: 32px;
}

/* Галерея */
.gallery-section {
  background: var(--bg-section);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.gallery-grid .media-frame {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
}

.gallery-grid .media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Второе видео */
.video-section {
  padding: 48px 0;
}

.media-frame-video {
  max-width: 360px;
  margin: 0 auto;
}

.media-frame-video .media-video {
  aspect-ratio: 9 / 16;
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Пожелания */
.wish-meme {
  font-size: 18px;
  text-align: center;
  color: var(--accent-deep);
  margin-top: 24px;
}

/* Напоминание */
.reminder {
  padding: 48px 0;
}

.reminder-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-style: italic;
  text-align: center;
  color: var(--text-soft);
  line-height: 1.6;
  text-shadow: 0 0 30px rgba(232, 196, 196, 0.3);
}

/* ============================================
   Таймер
   ============================================ */
.timer-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--rose-soft) 100%);
  padding: 80px 0 100px;
}

.timer {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.timer-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  display: block;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.timer-label {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.love-phrase-wrap {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.love-phrase {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.love-phrase.fade {
  opacity: 0;
}

/* ============================================
   Футер
   ============================================ */
.footer {
  padding: 48px 24px;
  text-align: center;
  background: var(--text);
  color: var(--bg);
}

.footer p {
  font-size: 18px;
  margin-bottom: 8px;
}

.footer-signature {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-style: italic;
  opacity: 0.9;
  margin: 4px 0 12px;
}

.footer-small {
  font-size: 13px;
  opacity: 0.7;
}

/* Летающие сердечки при тапе */
#heartsContainer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

.floating-heart {
  position: absolute;
  font-size: 28px;
  color: var(--rose);
  opacity: 0.9;
  animation: floatUp 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% {
    opacity: 0.9;
    transform: translateY(0) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.2);
  }
}

/* Секретное послание */
.secret-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 38, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 24px;
}

.secret-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.secret-content {
  background: var(--bg);
  padding: 40px 32px;
  border-radius: 20px;
  max-width: 360px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.4s ease;
}

.secret-overlay.visible .secret-content {
  transform: scale(1);
}

.secret-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 24px;
}

.secret-close {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 12px 24px;
  background: var(--rose);
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.secret-close:hover {
  background: var(--rose-soft);
}

.secret-close:active {
  transform: scale(0.98);
}

/* Сезонные эффекты */
#seasonalEffects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.season-particle {
  position: absolute;
  pointer-events: none;
  animation: fallDown linear forwards;
}

@keyframes fallDown {
  to {
    transform: translateY(120vh) rotate(360deg);
  }
}

/* Конфетти */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ============================================
   Адаптив — планшеты и десктоп
   ============================================ */
@media (min-width: 600px) {
  .container {
    padding: 0 32px;
  }

  .media-frame-accent {
    max-width: 420px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 640px;
  }

  .media-frame-video {
    max-width: 340px;
  }

  .hero-title {
    font-size: 52px;
  }

  .section-title {
    font-size: 38px;
  }

  .text-block {
    font-size: 18px;
  }

  .timer {
    gap: 24px;
  }

  .timer-value {
    font-size: 44px;
  }

  .timer-block {
    min-width: 90px;
  }
}

@media (min-width: 900px) {
  .hero-title {
    font-size: 60px;
  }

  .section {
    padding: 80px 0;
  }

  .media-frame-accent {
    max-width: 480px;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 720px;
  }
}
