/* ============================================
   MODERN MINIMALIST WEDDING WEBSITE
   All features + bug fixes
   ============================================ */

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

:root {
    --primary: #8B7355;
    --primary-light: #A89080;
    --secondary: #2C3539;
    --accent: #D4C5B9;
    --text-dark: #2C3539;
    --text-light: #6B7280;
    --bg-light: #FAF9F7;
    --white: #FFFFFF;
    --border: #E5E5E5;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    --section-padding: 120px;
    --container-max: 1200px;
    --container-narrow: 800px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 16px;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   2.6 TOP PROGRESS BAR
   ============================================ */

.top-progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.4s ease;
    opacity: 1;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ============================================
   MUSIC PLAYER
   ============================================ */

.music-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}

.music-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(139, 115, 85, 0.35);
    transition: all 0.3s ease;
}

.music-btn:hover { background: var(--secondary); transform: scale(1.08); }
.music-btn.playing { animation: musicPulse 2s ease-in-out infinite; }
.music-icon { font-size: 20px; color: var(--white); line-height: 1; }

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(139,115,85,0.35); }
    50%       { box-shadow: 0 4px 28px rgba(139,115,85,0.6); }
}

/* ============================================
   NAVIGATION (+ 2.13 hamburger, 2.14 active)
   ============================================ */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav.visible { opacity: 1; pointer-events: auto; }

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active { color: var(--primary); }

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* 2.13 Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-hamburger:hover { background: rgba(139,115,85,0.08); }

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.nav-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   HERO
   ============================================ */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #FAF9F7 0%, #F5F3F0 100%);
    position: relative;
    padding-top: 60px;
}

.hero-content { max-width: 800px; padding: 0 20px; }

.hero-date-small {
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--text-light);
    margin-bottom: 30px;
    font-weight: 300;
}

.hero-names {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.8;
}

.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); }

.scroll-line {
    width: 1px; height: 60px;
    background: linear-gradient(to bottom, var(--primary), transparent);
    animation: scrollAnim 2s ease-in-out infinite;
}

@keyframes scrollAnim {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50%       { opacity: 1; transform: translateY(20px); }
}

/* ============================================
   CONTAINERS
   ============================================ */

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 40px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 40px; }

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    text-align: center;
    margin-bottom: 80px;
    color: var(--text-dark);
}

/* ============================================
   COUNTDOWN
   ============================================ */

.countdown-section { padding: var(--section-padding) 0; background: var(--white); }

.countdown-title {
    text-align: center;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 60px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.countdown-item {
    text-align: center;
    padding: 40px 20px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.3s ease;
}

.countdown-item:hover { border-color: var(--primary); }

.countdown-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 300;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 15px;
}

.countdown-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-light); }

/* ============================================
   STORY
   ============================================ */

.story-section { padding: var(--section-padding) 0; background: var(--bg-light); }
.story-text { text-align: center; font-size: 18px; line-height: 2; color: var(--text-light); }
.story-text p { margin-bottom: 30px; }

/* ============================================
   DETAILS
   ============================================ */

.details-section { padding: var(--section-padding) 0; background: var(--white); }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }

.detail-box {
    text-align: center;
    padding: 50px 30px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-box:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.07); }
.detail-box-wide { grid-column: span 2; }
.detail-label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-light); margin-bottom: 20px; }
.detail-value { font-family: var(--font-heading); font-size: 24px; color: var(--text-dark); margin-bottom: 10px; }
.detail-address { font-size: 14px; color: var(--text-light); margin-top: 10px; }

/* ============================================
   2.15 SCHEDULE / TIMELINE
   ============================================ */

.schedule-section { padding: var(--section-padding) 0; background: var(--bg-light); }

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--border);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 50px;
    position: relative;
}

.timeline-left { flex-direction: row-reverse; text-align: right; }
.timeline-right { flex-direction: row; text-align: left; }

.timeline-dot {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 12px rgba(139,115,85,0.15);
}

.timeline-content { flex: 1; padding: 22px 28px; background: var(--white); border: 1px solid var(--border); border-radius: 4px; }

.timeline-time {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.timeline-desc { font-size: 14px; color: var(--text-light); line-height: 1.6; }

/* ============================================
   MAP
   ============================================ */

.map-section { padding: var(--section-padding) 0; background: var(--bg-light); }
.map-wrapper { margin-bottom: 40px; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
#yandex-map { width: 100%; height: 500px; }
.map-action { text-align: center; }

/* ============================================
   GALLERY (2.1 empty state, 2.10 skeleton)
   ============================================ */

.gallery-section { padding: var(--section-padding) 0; background: var(--white); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gallery-columns, 4), 1fr);
    gap: var(--gallery-gap, 12px);
    min-height: 300px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 2px;
    cursor: pointer;
    background: var(--bg-light);
    aspect-ratio: 1 / 1;
    /* Stagger animation */
    opacity: 0;
    transform: translateY(18px);
    animation: galleryItemIn 0.5s var(--stagger-easing, ease) var(--stagger-delay, 0ms) both;
}

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

.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease, opacity 0.4s ease; }
.gallery-item:hover img { transform: scale(1.04); }

/* skeleton placeholder keeps aspect ratio */
.gallery-item.gallery-skeleton { aspect-ratio: 1 / 1; }
.gallery-item.gallery-loaded { aspect-ratio: 1 / 1; }


/* Разделители галереи */
.gallery-section-label {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--primary, #8B7355);
    text-align: center;
    margin: 0 0 24px;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 16px;
}
.gallery-section-label::before,
.gallery-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary, #8B7355), transparent);
    opacity: 0.3;
}
#gallery-guests-block {
    margin-top: 48px;
}

.gallery-item { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 2px; cursor: pointer; background: var(--bg-light); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease, opacity 0.4s ease; }
.gallery-item:hover img { transform: scale(1.05); }

/* 2.10 Skeleton loader */
.gallery-skeleton { background: var(--bg-light); cursor: default; }
.skeleton-inner {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #f0ede8 25%, #e8e3dc 50%, #f0ede8 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-loaded img { animation: fadeInGallery 0.4s ease; }
@keyframes fadeInGallery { from { opacity: 0; } to { opacity: 1; } }

.gallery-img-error {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); font-size: 2rem; opacity: 0.4;
}

/* 2.1 Empty state */
.gallery-empty {
    width: 100%;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.gallery-empty-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 0;
    animation: cameraFloat 3s ease-in-out infinite;
}

@keyframes cameraFloat {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50%       { transform: translateY(-10px); opacity: 1; }
}

.gallery-empty-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-dark);
    margin: 0;
    animation: fadeInUp 0.8s ease both;
}

.gallery-empty-text {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.8;
    margin: 0;
    animation: fadeInUp 0.8s 0.2s ease both;
}

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

/* ============================================
   LIGHTBOX (2.17 counter, 2.16 swipe)
   ============================================ */

.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center; justify-content: center;
}

.lightbox.open { display: flex; animation: lightboxBgIn 0.25s ease both; }

@keyframes lightboxBgIn {
    from { background: rgba(0,0,0,0); }
    to   { background: rgba(0,0,0,0.92); }
}

.lightbox-content {
    max-width: 90vw; max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
    animation: lightboxZoomIn 0.35s cubic-bezier(0.34,1.2,0.64,1) both;
}

@keyframes lightboxZoomIn {
    from { opacity: 0; transform: scale(0.72); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox-content img {
    max-width: 100%; max-height: 90vh;
    object-fit: contain; border-radius: 2px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute; top: 20px; right: 30px;
    background: none; border: none; color: white;
    font-size: 42px; cursor: pointer; line-height: 1;
    opacity: 0.8; transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: none; color: white;
    font-size: 48px; cursor: pointer; padding: 10px 18px;
    border-radius: 2px; transition: background 0.2s; line-height: 1;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }

/* 2.17 Photo counter */
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 20px;
    font-family: var(--font-body);
    backdrop-filter: blur(4px);
}

/* ============================================
   RSVP (1.1/1.2 validation, 1.6 submitted msg)
   ============================================ */

.rsvp-section { padding: var(--section-padding) 0; background: var(--bg-light); }

.rsvp-deadline {
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* 2.3 Guest counter */
.guest-counter {
    text-align: center;
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 36px;
    letter-spacing: 0.5px;
}

.rsvp-form {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsvp-form input,
.rsvp-form select {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    height: 54px;
}

.rsvp-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.rsvp-form input:focus,
.rsvp-form select:focus { border-color: var(--primary); }

/* Fix 1.1/1.2 validation states */
.input-error { border-color: #ef4444 !important; }
.input-valid { border-color: #22c55e !important; }

.field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: -8px;
    padding: 0 4px;
    display: none;
}

.rsvp-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.3s ease;
    outline: none;
    resize: vertical;
    min-height: 90px;
}
.rsvp-textarea:focus { border-color: var(--primary); }

.form-row-two { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }

.form-message {
    display: none;
    margin-top: 20px;
    padding: 18px 24px;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
    line-height: 1.6;
}
.form-message.success { background: #F0FBF4; color: #1E6B40; border: 1px solid #A7DFBE; display: block; }
.form-message.error   { background: #FFF4F4; color: #B91C1C; border: 1px solid #FCA5A5; display: block; }

/* Fix 1.6: Already submitted message */
.rsvp-submitted-msg {
    text-align: center;
    padding: 40px 20px;
    max-width: 560px;
    margin: 0 auto;
}
.rsvp-submitted-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #F0FBF4;
    border: 2px solid #22c55e;
    color: #22c55e;
    font-size: 24px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.rsvp-submitted-text { font-size: 18px; color: var(--text-dark); margin-bottom: 8px; }
.rsvp-submitted-hint { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.btn-change-rsvp {
    font-size: 13px; color: var(--text-light);
    background: none; border: 1px solid var(--border);
    padding: 10px 24px; border-radius: 2px; cursor: pointer;
    transition: all 0.3s;
}
.btn-change-rsvp:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 16px 50px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    width: 100%;
    text-align: center;
}
.btn-primary:hover { background: var(--secondary); border-color: var(--secondary); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ============================================
   WISHES
   ============================================ */

.wishes-section { padding: var(--section-padding) 0; background: var(--white); }

.wishes-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--text-light);
    margin-top: -50px;
    margin-bottom: 60px;
    font-weight: 300;
}

.wishes-form {
    max-width: 560px;
    margin: 0 auto 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wishes-form input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-light);
    transition: border-color 0.3s;
    outline: none;
    height: 54px;
}
.wishes-form input:focus { border-color: var(--primary); }

.wishes-list { max-width: 700px; margin: 0 auto; }

.wish-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px 32px;
    margin-bottom: 20px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: wishAppear 0.5s forwards;
}

@keyframes wishAppear { to { opacity: 1; transform: translateY(0); } }

.wish-card::before {
    content: '"';
    position: absolute;
    top: 12px; left: 20px;
    font-family: var(--font-heading);
    font-size: 60px;
    color: var(--accent);
    line-height: 1;
    opacity: 0.6;
}

.wish-text { font-size: 16px; line-height: 1.8; color: var(--text-dark); margin-bottom: 16px; padding-top: 20px; }
.wish-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-light); }
.wish-author { font-weight: 500; }
.wish-date { font-style: italic; }
.wishes-empty { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 16px; }

/* ============================================
   FOOTER + 2.7 SHARE + 2.8 VCF
   ============================================ */

.footer { padding: 20px 10px; background: var(--secondary); color: var(--white); margin-top: auto; }
.main-content { flex: 1; }
.footer-content { text-align: center; }
.footer-text { font-family: var(--font-heading); font-size: 28px; font-weight: 300; margin-bottom: 30px; }
.footer-year { font-size: 14px; letter-spacing: 2px; color: rgba(255,255,255,0.6); margin-top: 20px; }

.share-section { margin: 24px auto; }
.share-title { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 14px; }

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

.share-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.share-btn:hover { background: rgba(255,255,255,0.2); color: white; transform: scale(1.1); }
.share-wa:hover  { background: #25D366; border-color: #25D366; }
.share-tg:hover  { background: #229ED9; border-color: #229ED9; }

/* ============================================
   P.2 POST-WEDDING FULLSCREEN OVERLAY
   ============================================ */
.pw-overlay {
    position: fixed; inset: 0;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    background: var(--secondary, #3d2c1e);
    color: #fff;
}
.pw-overlay .pw-bg {
    position: fixed; inset: 0;
    background-size: cover; background-position: center;
    pointer-events: none;
}
.pw-overlay .pw-bg::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,0.55);
}
.pw-overlay .pw-content {
    position: relative; z-index: 1;
    padding: 80px 24px 60px;
    max-width: 600px; width: 100%;
    text-align: center;
    animation: pwFadeIn 1.2s ease;
}
@keyframes pwFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pw-overlay .pw-icon    { font-size: 52px; margin-bottom: 20px; }
.pw-overlay .pw-names   { font-family: var(--font-heading); font-size: clamp(2.5rem, 7vw, 4.5rem); font-weight: 300; margin-bottom: 20px; line-height: 1.1; }
.pw-overlay .pw-message { font-size: 18px; font-weight: 300; line-height: 1.8; opacity: 0.9; }
.pw-overlay .pw-date    { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; opacity: 0.6; margin-top: 30px; }

/* Post-wedding gallery */
.pw-gallery-section {
    position: relative; z-index: 1;
    width: 100%; max-width: 1100px;
    padding: 0 24px 80px;
    animation: pwFadeIn 1.5s ease 0.3s both;
}
.pw-gallery-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 300;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 2px;
    opacity: 0.95;
}
.pw-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.pw-gallery-item {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: rgba(255,255,255,0.08);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.pw-gallery-item:hover { transform: scale(1.02); opacity: 0.92; }
.pw-gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.pw-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
}
.pw-gallery-empty-icon { font-size: 48px; margin-bottom: 16px; animation: pwCameraFloat 3s ease-in-out infinite; }
@keyframes pwCameraFloat {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.pw-gallery-empty-text { font-size: 20px; font-weight: 300; margin-bottom: 8px; }
.pw-gallery-empty-sub  { font-size: 14px; opacity: 0.7; }

@media (max-width: 768px) {
    .pw-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .pw-overlay .pw-content { padding: 60px 20px 40px; }
}

/* ============================================
   2.5 TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 340px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast-show { opacity: 1; transform: translateX(0); }
.toast-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.toast-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-info    { background: var(--bg-light); color: var(--text-dark); border: 1px solid var(--border); }

/* ============================================
   QR MODAL (2.7)
   ============================================ */

.qr-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
    align-items: center; justify-content: center;
}
.qr-modal.qr-open { display: flex; }

.qr-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.qr-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light);
}
.qr-close:hover { color: var(--text-dark); }
.qr-title { font-family: var(--font-heading); font-size: 22px; margin-bottom: 20px; }
.qr-img { border-radius: 8px; border: 1px solid var(--border); display: block; margin: 0 auto 16px; }
.qr-subtitle { font-size: 13px; color: var(--text-light); }
.qr-warning { font-size: 12px; color: #B45309; background: #FFF7ED; border: 1px solid #FDE68A; border-radius: 4px; padding: 8px 12px; margin-top: 10px; }
.qr-spinner { text-align: center; padding: 20px 0; }
.qr-spinner-ring {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--primary);
    animation: qrSpin 0.8s linear infinite; margin: 0 auto 10px;
}
@keyframes qrSpin { to { transform: rotate(360deg); } }
.qr-spinner-text { font-size: 13px; color: var(--text-light); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    :root { --section-padding: 80px; }

    /* 2.13 Hamburger — show on mobile */
    .nav-hamburger { display: flex; }

    .nav-container { padding: 12px 16px; justify-content: flex-start; min-height: 52px; }

    /* Mobile nav drawer */
    .nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        flex-direction: column;
        align-items: center;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease;
        padding: 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .nav-links.nav-open {
        max-height: 360px;
        padding: 8px 0;
    }

    .nav-link {
        width: 100%;
        padding: 10px 20px;
        font-size: 12px;
        text-align: center;
        border-bottom: 1px solid var(--border);
    }
    .nav-link:last-child { border-bottom: none; }
    .nav-link::after { display: none; }
    .nav-link.active { background: var(--bg-light); color: var(--primary); }

    .container, .container-narrow { padding: 0 20px; }

    .hero-names { font-size: 3rem; }
    .section-title { margin-bottom: 50px; }

    .countdown-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .countdown-num { font-size: 3rem; }

    .details-grid { grid-template-columns: 1fr; }
    .detail-box-wide { grid-column: span 1; }

    .form-row-two { grid-template-columns: 1fr; }

    .gallery-grid { grid-template-columns: repeat(min(var(--gallery-columns, 4), 3), 1fr); }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }

    .music-player { bottom: 20px; right: 20px; }
    .wish-card { padding: 22px 20px; }

    /* Timeline — single column on mobile */
    .timeline::before { left: 26px; }
    .timeline-item { flex-direction: row !important; text-align: left !important; }
    .timeline-dot { width: 44px; height: 44px; font-size: 18px; }

    #toast-container { right: 12px; bottom: 80px; }
    .toast { min-width: 200px; }

    .share-buttons { gap: 10px; }
    .share-btn { width: 40px; height: 40px; }
}

@media (max-width: 480px) {
    .countdown-item { padding: 30px 15px; }
    .countdown-num { font-size: 2.5rem; }
    .gallery-grid { grid-template-columns: repeat(min(var(--gallery-columns, 4), 2), 1fr); }
}

/* ===== Focus outline reset ===== */
.wish-card:focus, .wish-card:focus-visible, .wishes-list:focus { outline: none; }

/* ===== Task 3: Together counter ===== */
.hero-together {
    font-size: 1rem;
    opacity: 0.75;
    margin-top: 10px;
    font-style: italic;
    letter-spacing: 0.05em;
}

/* ===== Task 4: Hero quote ===== */
.hero-quote {
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.7;
    margin: 12px auto 0;
    max-width: 480px;
    border-left: none;
    padding: 0;
    text-align: center;
    line-height: 1.6;
}

/* ===== Task 5: Hero video background ===== */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

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

/* ===== Task 16: Guest photos section ===== */
.guest-photos-section {
    padding: 80px 0;
    text-align: center;
}

/* ════════════════════════════════
   ENVELOPE
   ════════════════════════════════ */

/* Затемнённый оверлей на весь экран */
/* ══════════════════════════════════════════════
   NEW ENVELOPE / INVITATION CARD DESIGN
   Clean, minimalist card matching the reference screenshot
   ══════════════════════════════════════════════ */

#envelope-overlay {
    position: fixed;
    inset: 0;
    background: #f8f6f3;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.envelope-active { overflow: hidden; height: 100vh; }

.env-invite-card {
    width: 100%;
    max-width: 400px;
    padding: 0 24px;
    animation: envCardAppear 0.7s cubic-bezier(0.34,1.1,0.64,1) both;
}

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

.env-invite-inner {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 40px 44px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.env-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent, #8B7355);
}

.env-meta-icon {
    display: flex;
    align-items: center;
    opacity: 0.8;
    flex-shrink: 0;
}

.env-meta-text {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.85rem;
    color: #555;
    letter-spacing: 0.02em;
}

.env-names {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: 2.8rem;
    font-style: italic;
    font-weight: 400;
    color: #1a1a1a;
    margin: 18px 0 12px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* The & in names */
.env-names em {
    font-style: italic;
    color: var(--accent, #8B7355);
}

.env-greeting {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.82rem;
    color: #888;
    font-style: italic;
    margin: 0 0 28px;
    letter-spacing: 0.03em;
    line-height: 1.6;
}

.env-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 40px;
    background: var(--accent, #8B7355);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(139,115,85,0.35);
    text-transform: none;
    width: 100%;
    justify-content: center;
}

.env-open-btn:hover {
    opacity: 0.92;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(139,115,85,0.4);
}

#envelope-confetti {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 10001;
}

@media (max-width: 440px) {
    .env-invite-inner { padding: 36px 24px 32px; }
    .env-names { font-size: 2.2rem; }
}

/* ════════════════════════════════
   RSVP DEADLINE NOTICE
   ════════════════════════════════ */
.rsvp-deadline-notice {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-dark, #2C3539);
}
.rsvp-deadline-notice p {
    margin: 12px 0 0;
    opacity: 0.7;
    font-size: 1rem;
}
.rsvp-deadline-icon {
    font-size: 2.5rem;
    display: block;
}