* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background-color: #f9f9f7;
    color: #4a5345;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Главное фото с лепестками */
/* Главное фото с лепестками */
.main-photo {
    position: relative;
    width: 100%;  /* вместо 90vw */
    height: 100vh;  /* вместо 90vh */
    background-image: url('hero1.jpg');
    background-size: 105%;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(180, 189, 170, 0.15);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.invitation-text {
    color: #3a4235;
    max-width: 90%;
    z-index: 2;
}

.names {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.7);
}

.ampersand {
    font-family: 'Marck Script', cursive;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    color: #637257;
    margin: 0 10px;
}

.date-location {
    margin: 2rem 0;
    font-size: clamp(1rem, 3vw, 1.4rem);
}

.date, .location {
    margin: 0.8rem 0;
    font-weight: 400;
}

.date i, .location i {
    margin-right: 10px;
    color: #768b7a;
}

.quote {
    font-family: 'Marck Script', cursive;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: #4a5345;
    margin: 2.5rem 0;
    line-height: 1.4;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: gentleBounce 2s infinite;
    cursor: pointer;
    z-index: 3;
}

.scroll-indicator i {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #637257;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.scroll-indicator:hover i {
    opacity: 1;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0) translateX(-50%); }
    50% { transform: translateY(-8px) translateX(-50%); }
}

/* ========== БЛОКИ С РАСТВОРЕНИЕМ ФОТО ========== */
.section-bg {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    width: 100%;
    margin-top: -80px; /* Поднимаем блок на 80px для наложения */
    overflow: hidden;
}

/* СЛОЙ 1: Текущее фото блока */
.section-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* СЛОЙ 2: Предыдущее фото (растворяется в текущем) */
.section-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px; /* Зона растворения 160px */
    background-image: var(--prev-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    
    /* Градиент прозрачности для растворения */
    mask-image: linear-gradient(
        to bottom,
        rgba(0,0,0,1) 0%,      /* Полностью видно вверху */
        rgba(0,0,0,0.9) 10%,   /* Почти полностью видно */
        rgba(0,0,0,0.7) 25%,   /* Начинаем растворять */
        rgba(0,0,0,0.5) 40%,   /* Наполовину видно */
        rgba(0,0,0,0.3) 55%,   /* Почти не видно */
        rgba(0,0,0,0.1) 70%,   /* Едва видно */
        rgba(0,0,0,0) 85%      /* Полностью растворилось */
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.9) 10%,
        rgba(0,0,0,0.7) 25%,
        rgba(0,0,0,0.5) 40%,
        rgba(0,0,0,0.3) 55%,
        rgba(0,0,0,0.1) 70%,
        rgba(0,0,0,0) 85%
    );
}

/* Контентные блоки */
.message-content,
.timeline,
.dress-content,
.rsvp-content,
.contacts-content {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    width: 100%;
    max-width: 800px;
    margin: 40px auto 0; /* Отступ сверху чтобы не попадал в зону растворения */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* ========== ТЕКСТ ПРИГЛАШЕНИЯ ========== */
.message-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #4a5345;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.message-text {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    line-height: 1.6;
    text-align: center;
}

.message-text p {
    margin-bottom: 1.2rem;
    color: #4a5345;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.signature {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(180, 189, 170, 0.5);
}

.signature-names {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #637257;
    margin-top: 0.5rem;
}

/* ========== ЗАГОЛОВКИ СЕКЦИЙ ========== */
h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

h2 i {
    color: #879d90;
    font-size: clamp(1.2rem, 3vw, 1.4rem);
}

/* ========== РАСПИСАНИЕ ========== */
.timeline {
    margin-top: 1.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    max-width: 750px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(180, 189, 170, 0.5);
}

.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-time {
    min-width: 70px;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 500;
    color: #637257;
    padding-right: 1rem;
    font-family: 'Playfair Display', serif;
}

.timeline-content h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #4a5345;
    margin-bottom: 0.4rem;
}

.timeline-content p {
    color: #4a5345;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* ========== ДРЕСС-КОД ========== */
.dress-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 750px;
}

.dress-intro {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.dress-guidelines {
    background-color: rgba(212, 215, 200, 0.3);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.guideline {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 15px;
}

.guideline:last-child {
    margin-bottom: 0;
}

.guideline i {
    color: #879d90;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-top: 3px;
    min-width: 25px;
}

.guideline p {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #4a5345;
    margin-bottom: 0;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* ========== ПОДТВЕРЖДЕНИЕ ========== */
.rsvp-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 600px;
}

.rsvp-intro {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* ========== КОНТАКТЫ ========== */
.contacts-content {
    background-color: rgba(255, 255, 255, 0.9);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 800px;
}

.contacts-intro {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background-color: rgba(255, 255, 255, 0.95);
    padding: clamp(1.2rem, 2.5vw, 1.8rem);
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-icon {
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    background-color: rgba(180, 189, 170, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.contact-icon i {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: #637257;
}

.contact-info h3 {
    font-size: clamp(1.2rem, 2.8vw, 1.4rem);
    color: #4a5345;
    margin-bottom: 0.5rem;
    text-align: center;
}

.contact-info p {
    color: #4a5345;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    text-align: center;
}

.phone, .address {
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #768b7a;
    margin-top: 0.5rem;
}

/* Формы */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
}

input, select, textarea {
    width: 100%;
    padding: 14px 12px;
    border: 1px solid rgba(180, 189, 170, 0.7);
    border-radius: 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    background-color: rgba(255, 255, 255, 0.95);
    color: #4a5345;
    transition: all 0.3s;
    box-sizing: border-box;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #879d90;
    box-shadow: 0 0 0 2px rgba(135, 157, 144, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-note {
    background-color: rgba(212, 215, 200, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.2rem 0;
    text-align: center;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    color: #4a5345;
}

.form-note i {
    color: #879d90;
    margin-right: 8px;
}

.submit-btn {
    width: 100%;
    padding: 14px 12px;
    background: linear-gradient(to right, #a2ac94, #879d90);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.1rem, 2.8vw, 1.3rem);
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.submit-btn:hover {
    background: linear-gradient(to right, #879d90, #768b7a);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 114, 87, 0.2);
}

.form-message {
    margin-top: 1.2rem;
    padding: clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 8px;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    display: none;
    background-color: rgba(180, 189, 170, 0.3);
    border: 1px solid rgba(162, 172, 148, 0.5);
    color: #4a5345;
}

/* ========== ФУТЕР ========== */
footer {
    background-color: rgba(180, 189, 170, 0.15);
    padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem);
    text-align: center;
    border-top: 1px solid rgba(180, 189, 170, 0.3);
    /*margin-top: -80px; /* Компенсируем поднятие блока контактов */
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.footer-quote {
    font-family: 'Marck Script', cursive;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: #4a5345;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.footer-names {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 1.5rem 0;
}

.footer-names .name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    color: #637257;
}

.footer-names .heart {
    color: #879d90;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.wedding-date {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #768b7a;
    margin-top: 1rem;
}

.floral-border {
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(180, 189, 170, 0.3),
        rgba(162, 172, 148, 0.5),
        rgba(180, 189, 170, 0.3)
    );
    margin-top: 2rem;
    border-radius: 2px;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
    }
    
    .contact-cards {
        flex-direction: row;
        justify-content: center;
    }
    
    .contact-card {
        flex: 1;
        max-width: 300px;
    }
}

@media (max-width: 767px) {
    .section-bg {
        margin-top: -60px; /* Меньше наложение на мобильных */
    }
    
    .section-bg::after {
        height: 120px; /* Меньше зона растворения */
    }
    
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        margin: 30px auto 0;
        padding: 1.5rem;
        width: 100%;
    }
    
    footer {
        margin-top: -60px;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-time {
        padding-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .guideline {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .guideline i {
        margin-bottom: 5px;
    }
    
    footer {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 400px) {
    .section-bg {
        margin-top: -40px;
        padding: 1rem 0.8rem;
    }
    
    .section-bg::after {
        height: 80px;
    }
    
    .message-content,
    .timeline,
    .dress-content,
    .rsvp-content,
    .contacts-content {
        margin: 20px auto 0;
        padding: 1.2rem;
    }
    
    footer {
        margin-top: -40px;
    }
    
    input, select, textarea {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 12px 10px;
    }
    
    .footer-names {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-names .heart {
        transform: rotate(90deg);
    }
}

/* iOS фикс */
@media screen and (max-width: 767px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ========== КНОПКА МУЗЫКИ ========== */
.music-control {
    margin: 1rem 0 1.5rem 0;
}

.music-btn {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(180, 189, 170, 0.5);
    padding: 10px 20px;
    border-radius: 40px;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 500;
    color: #4a5345;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.music-btn i {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #637257;
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.music-btn.playing {
    background: rgba(100, 115, 90, 0.85);
    color: white;
}

.music-btn.playing i {
    color: white;
    animation: musicPulse 1s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
    .music-btn {
        padding: 8px 16px;
    }
}

/* Каждый блок имеет свою собственную подложку */
.info-block {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Отступ между блоками */
.info-block:first-child {
    margin-bottom: 2rem;
}

/* Стили для контактной карточки внутри блока */
.info-block:last-child .contact-card {
    background: transparent;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.info-block:last-child .contact-card:hover {
    transform: none;
}

/* Адаптация */
@media (max-width: 767px) {
    .info-block:first-child {
        margin-bottom: 1.5rem;
    }
}

/* Убираем синее выделение при нажатии на кнопки */
button,
.submit-btn,
.music-btn,
.scroll-indicator,
[role="button"],
a {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Дополнительно для кнопок с фокусом */
button:focus,
.submit-btn:focus,
.music-btn:focus {
    outline: none;
}

/* Для элементов с :active состоянием */
button:active,
.submit-btn:active,
.music-btn:active,
.scroll-indicator:active {
    -webkit-tap-highlight-color: transparent;
    transform: scale(0.98);
}
