:root {
    --bg-color: #fdfbf7;
    --text-main: #4a4040;
    --text-light: #7a6e6e;
    --accent-color: #d8a7a7;
    --accent-hover: #c48b8b;
    --card-bg: rgba(255, 255, 255, 0.6);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #fdfbf7 0%, #faefe9 50%, #f4e1e1 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden; /* Скрываем скролл, навигация через JS */
    line-height: 1.6;
}

/* Канвас для частиц */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Прогресс-бар */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    width: 0%;
    z-index: 1000;
    transition: width 0.4s ease;
}

/* Управление (музыка, объятия) */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 15px;
}

.controls button {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 30px;
    padding: 10px 20px;
    font-family: var(--font-body);
    color: var(--text-main);
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.controls button:hover {
    background: white;
    transform: translateY(-2px);
}

/* Страницы */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s ease;
    transform: translateY(20px);
    overflow-y: auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.content {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

/* Типографика */
.title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: var(--text-main);
}
.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}
.text-body {
    font-size: 1.1rem;
    color: var(--text-main);
}
.text-center { text-align: center; }
.text-large { font-size: 1.5rem; font-style: italic; }
.handwriting { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.5rem; }
.mt-2 { margin-top: 2rem; }
.max-w { max-width: 600px; margin: 0 auto 40px; }

/* Карточки (Glassmorphism) */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 50px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 10px 40px rgba(216, 167, 167, 0.15);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.feature-card {
    background: rgba(255,255,255,0.7);
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.4s, box-shadow 0.4s;
    border: 1px solid rgba(255,255,255,0.9);
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(216, 167, 167, 0.2);
}
.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Фото и Галерея */
.photo-placeholder {
    background: linear-gradient(135deg, #eadddd 0%, #f7eded 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-hover);
    font-style: italic;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.5);
    transition: transform 0.3s;
}
.rounded-photo {
    width: 250px;
    height: 300px;
    border-radius: 100px 100px 20px 20px;
    margin: 30px auto;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}
.gallery-item {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
}
.gallery-item .photo-placeholder {
    height: 200px;
    border-radius: 12px;
}
.gallery-item.vertical .photo-placeholder { height: 300px; }
.gallery-item.horizontal { grid-column: span 2; }
.gallery-item:hover .photo-placeholder { transform: scale(1.03); }

/* Кнопки */
.btn-elegant {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--text-main);
    padding: 15px 40px;
    font-size: 1rem;
    font-family: var(--font-body);
    border-radius: 30px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-elegant:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 5px 15px rgba(216, 167, 167, 0.4);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--text-light);
    padding: 15px 30px;
    border-radius: 20px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.5);
    transform: translateY(-3px);
}
.buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 30px auto;
}

/* Навигация (стрелки) */
.nav-arrows {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    padding-bottom: 40px;
}
.nav-arrow {
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}
.nav-arrow:hover {
    color: var(--accent-color);
    box-shadow: 0 6px 15px rgba(216, 167, 167, 0.3);
}

/* Спасибо тебе (Скролл карточки) */
.thanks-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}
.thank-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    border-left: 4px solid var(--accent-color);
    opacity: 0.8;
    transform: translateY(20px);
    transition: all 0.5s;
}
.thank-card:hover {
    opacity: 1;
    transform: translateX(10px);
}

/* Конверты */
.envelopes-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
    flex-wrap: wrap;
}
.envelope {
    font-size: 4rem;
    cursor: pointer;
    transition: transform 0.3s;
}
.envelope:hover {
    transform: translateY(-10px) rotate(5deg);
}
.envelope.opened {
    font-size: 1.2rem;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 250px;
    animation: fadeIn 0.5s forwards;
    cursor: default;
}

/* Письмо */
.letter-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.envelope-big {
    background: #fdf5f5;
    border: 2px dashed var(--accent-color);
    padding: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    transition: opacity 0.5s;
    z-index: 2;
}
.letter-paper {
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(50px);
    transition: all 0.8s ease;
    z-index: 1;
}
.letter-wrapper.open .envelope-big {
    opacity: 0;
    visibility: hidden;
}
.letter-wrapper.open .letter-paper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.letter-paper p {
    margin-bottom: 15px;
}

/* Таймлайн */
.timeline {
    position: relative;
    max-width: 600px;
    margin: 40px auto;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0.5;
}
.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
    cursor: pointer;
}
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s;
}
.timeline-item:hover .timeline-dot {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}
.timeline-content h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 5px;
}
.hidden-text {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
    color: var(--text-light);
}
.timeline-item.active .hidden-text {
    max-height: 100px;
    opacity: 1;
    margin-top: 10px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(253, 251, 247, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal.show {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    position: relative;
    font-family: var(--font-heading);
    font-size: 1.5rem;
}
.close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* Финал и Пасхалка */
.giant-title {
    font-size: 4rem;
    color: var(--accent-hover);
}
.footer-note {
    font-size: 0.9rem;
    color: var(--text-light);
}
.easter-egg {
    position: absolute;
    bottom: 10px;
    font-size: 0.7rem;
    color: rgba(0,0,0,0.1);
    cursor: pointer;
    transition: color 0.3s;
}
.easter-egg:hover { color: var(--text-light); }

/* Анимации задержки для финала */
.delay-1 { animation: fadeIn 2s 0.5s forwards; opacity: 0; }
.delay-2 { animation: fadeIn 2s 2s forwards; opacity: 0; }
.delay-3 { animation: fadeIn 2s 3.5s forwards; opacity: 0; }
.delay-4 { animation: fadeIn 2s 5s forwards; opacity: 0; }

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Летающие сердечки */
.floating-heart {
    position: fixed;
    bottom: -50px;
    color: var(--accent-color);
    font-size: 24px;
    animation: floatUp 4s ease-in forwards;
    pointer-events: none;
    z-index: 9999;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .title { font-size: 2.2rem; }
    .giant-title { font-size: 2.5rem; }
    .glass-card { padding: 30px 20px; }
    .page { padding: 80px 15px 20px; }
    .controls { top: 10px; right: 10px; }
    .controls button { padding: 8px 15px; font-size: 0.9rem; }
}