:root {
    --primary: #FF3366;
    --bg: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --transition: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
  
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
  
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    color: var(--text);
}
  
html {
    height: -webkit-fill-available;
}
  
main {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
  
.section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}
  
.welcome-section {
    text-align: center;
}
  
.welcome-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}
  
.name {
    display: block;
    font-size: 3.5rem;
    color: var(--primary);
    font-weight: 600;
    margin: 0.5rem 0;
}
  
.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}
  
.section.hidden {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}
  
.section.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
  
.section.exit {
    opacity: 0;
    transform: translateY(-30px);
}
  
/* Падающие сердечки (фон) */
.falling-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
  
.heart {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    transform: rotate(45deg);
    opacity: 0.15;
}
  
.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: inherit;
}
  
.heart::before {
    left: -4px;
}
  
.heart::after {
    top: -4px;
}
  
/* Глобальные точки навигации */
.global-nav-dots {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1000;
}
  
.global-nav-dots .nav-dot {
    width: 6px;
    height: 6px;
    background: var(--text);
    border-radius: 50%;
    opacity: 0.2;
    transition: var(--transition);
}
  
.global-nav-dots .nav-dot.active {
    opacity: 1;
    background: var(--primary);
}
  
/* Точки для галереи */
.gallery-section .nav-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}
  
.gallery-section .nav-dots .nav-dot {
    width: 10px;
    height: 10px;
    background: var(--text);
    border-radius: 50%;
    opacity: 0.3;
    transition: var(--transition);
}
  
.gallery-section .nav-dots .nav-dot.active {
    opacity: 1;
    background: var(--primary);
}
  
/* Кнопка музыки */
.music-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text);
    opacity: 0.5;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}
  
.music-toggle:hover,
.music-toggle:focus {
    opacity: 1;
}
  
@keyframes fadeIn {
    from { 
      opacity: 0;
      transform: translateY(10px);
    }
    to { 
      opacity: 1;
      transform: translateY(0);
    }
}
  
/* Медиа-запросы для больших экранов */
@media (min-width: 768px) {
    .welcome-title {
      font-size: 3rem;
    }
    .name {
      font-size: 4rem;
    }
    .welcome-subtitle {
      font-size: 1.2rem;
    }
}
  
/* Секции истории */
.story-content {
    max-width: 100%;
    padding: 0 1rem;
    text-align: center;
}
  
.story-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}
  
.story-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}
  
.story-image img {
    width: 100%;
    height: auto;
    display: block;
}
  
/* Галерея воспоминаний */
.gallery-container {
    width: 100%;
    height: 80vh;
    position: relative;
    overflow: hidden;
    touch-action: none;
}
  
.memory-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
  
.memory-item.active {
    opacity: 1;
    transform: translateX(0);
}
  
.memory-item img {
    max-height: 70%;
    width: auto;
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
  
.memory-caption {
    margin-top: 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}
  
.memory-item.active .memory-caption {
    opacity: 1;
    transform: translateY(0);
}
  
.memory-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}
  
.memory-nav {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px;
}
  
.nav-prev, .nav-next {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}
  
.nav-prev:hover, .nav-next:hover {
    transform: scale(1.1);
    background: white;
}
  
/* Секция с фото */
.photo-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    margin: 0;
    padding: 0;
}
  
.photo-section img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
    padding: 0;
    border-radius: 0;
}
  
.photo-section audio {
    display: none;
}
  
/* Секция комплиментов */
.compliments-section {
  text-align: center;
  padding: 2rem;
}
  
.compliments-title {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 2rem;
  font-weight: 300;
}
  
.media-carousel {
  width: 100%;
  height: 70vh;
  position: relative;
  overflow: hidden;
}
  
.media-item {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all 0.5s ease;
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
  
.media-item.active {
  opacity: 1;
  transform: translateX(0);
}
  
.media-item img,
.media-item video {
  max-height: 80%;
  width: auto;
  max-width: 100%;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(255, 51, 102, 0.2);
}
  
.media-caption {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  color: var(--text);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease 0.3s;
}
  
.media-item.active .media-caption {
  opacity: 1;
  transform: translateY(0);
}
  
/* Используем тот же стиль навигации, что и в галерее */
.media-nav {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 20px;
}
  
/* Секция секрет */
.secret-content {
    text-align: center;
}
  
.secret-button {
    font-size: 2rem;
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
}
  
.secret-button:hover {
    transform: scale(1.1);
}
  
.secret-message {
    margin-top: 1rem;
    opacity: 0;
    transition: var(--transition);
}
  
.secret-message.visible {
    opacity: 1;
}
  
/* Секция "любишь меня?" */
.love-question {
    text-align: center;
    width: 100%;
    padding: 2rem;
}
  
.question-text {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text);
    transition: opacity 0.4s ease;
}
  
.question-text.fade-out {
    opacity: 0;
}
  
/* Контейнер кнопок */
.buttons-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}
  
/* Кнопки */
.love-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    text-transform: lowercase;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.2);
    position: relative;
    z-index: 10;
}
  
.love-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.3);
}
  
.love-button.faded {
    opacity: 0;
}
  
.love-button.clicked {
    transform: scale(1.1);
}
  
/* Медиа-запросы для мобильных устройств */
@media screen and (max-width: 844px) {
    main { padding: 20px; max-width: 100%; }
    .section { padding: 20px 10px; }
    .welcome-title { font-size: 2.5rem; line-height: 1.2; }
    .welcome-subtitle { font-size: 1.2rem; margin-top: 15px; }
    .gallery-grid { grid-template-columns: 1fr; gap: 20px; padding: 10px; }
    .gallery-item { width: 100%; margin-bottom: 20px; }
    .gallery-item img { width: 100%; height: auto; border-radius: 15px; }
    .gallery-caption { font-size: 1rem; padding: 10px 5px; }
    .reasons-list { padding: 10px; }
    .reason-item { margin-bottom: 20px; padding: 15px; }
    .reason-number { font-size: 1.5rem; }
    .buttons-container { flex-direction: column; gap: 15px; }
    .love-button { width: 100%; padding: 15px; font-size: 1.1rem; }
    .secret-content { padding: 20px; }
    .secret-button { font-size: 2rem; padding: 20px 40px; }
    .music-toggle { top: 20px; right: 20px; font-size: 1.5rem; padding: 10px; }
    .nav-prev, .nav-next { width: 40px; height: 40px; font-size: 20px; }
    .memory-nav { bottom: 20px; gap: 20px; }
    /* Для секции комплиментов больше не переопределяем позиционирование навигации – используем тот же стиль, что и в галерее */
}
  
@media screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) {
    .welcome-title { font-size: 2.8rem; }
    .gallery-item img { border-radius: 20px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
    .music-toggle { top: 60px; }
}
  
@supports (padding-top: env(safe-area-inset-top)) {
    body {
      padding-top: env(safe-area-inset-top);
      padding-bottom: env(safe-area-inset-bottom);
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }
}
