:root {
    --bg-light: #FBF9F6;
    --text-dark: #2C3531;
    --text-muted: #646E68;
    --accent: #C4B7A6; /* Soft elegant beige/gold */
    --accent-dark: #A49786;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-body);
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
}

/* Background decorations */
.bg-decor {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

.bg-decor-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #ebe1d1 0%, transparent 70%);
    top: -200px;
    left: -200px;
}

.bg-decor-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #e9ece8 0%, transparent 70%);
    bottom: 20%;
    right: -150px;
}

p {
    margin: 0;
}

.invitation-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 30px;
    position: relative;
    z-index: 1;
}

.invitation-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(var(--accent-dark) 1px, transparent 1px);
    background-size: 35px 35px;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.invitation-container::after {
    content: '50';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: 40rem;
    color: var(--accent);
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
    line-height: 0.8;
}

/* Typography elements */
.section-heading {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 40px;
    font-style: italic;
}

.section-heading-small {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 80px;
    min-height: 70vh;
}

.hero-text {
    flex: 1;
    max-width: 450px;
    padding-right: 20px;
}

.subtitle {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-dark);
    margin-bottom: 20px;
    font-weight: 400;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 5.5rem;
    font-weight: 500;
    line-height: 1;
    margin: 0 0 10px 0;
    color: var(--text-dark);
}

.age-badge {
    font-family: var(--font-heading);
    font-size: 6.5rem;
    font-weight: 400;
    line-height: 1.1;
    padding-bottom: 15px;
    background: linear-gradient(135deg, #c7baab, #dfd0be, #b09e86);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 10px 0 20px 0;
    display: inline-block;
    position: relative;
}

.age-badge::after {
    content: "лет";
    position: absolute;
    bottom: 25px;
    right: -45px;
    font-size: 1.6rem;
    font-style: italic;
    -webkit-text-fill-color: var(--text-muted);
    color: var(--text-muted);
}

.hero-description {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 420px;
    margin-top: 20px;
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Decorative circle removed as requested */

.photo-frame {
    width: 100%;
    max-width: 550px;
    aspect-ratio: 1 / 1;
    border-radius: 12px 140px 12px 140px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.08);
}

.photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px 140px 12px 140px;
    border: 1px solid rgba(255,255,255,0.4);
    pointer-events: none;
}

.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: none;
}

/* Divider */
.divider {
    text-align: center;
    margin: 60px 0;
    opacity: 0.7;
}

/* Program Section */
.program-section {
    margin-bottom: 80px;
}

.program-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
    position: relative;
}

.program-grid::before {
    content: "Афиша";
    position: absolute;
    top: -60px;
    left: 10%;
    font-family: 'Great Vibes', cursive;
    font-size: 15rem;
    color: var(--accent);
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    transform: rotate(-5deg);
}

.program-day {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.04);
    border-top: 4px solid var(--accent);
    position: relative;
    z-index: 2;
}

.program-grid .program-day:nth-child(2) {
    margin-top: 80px;
}

.day-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 20px;
}

.day-num {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1;
    color: var(--accent-dark);
    margin-right: 15px;
}

.day-text {
    display: flex;
    flex-direction: column;
}

.month {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 500;
}

.day-label {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
}

.timeline-elegant {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-elegant li {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.timeline-elegant li:last-child {
    margin-bottom: 0;
}

.timeline-elegant .time {
    font-weight: 500;
    color: var(--accent-dark);
    width: 60px;
    font-size: 1.05rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.timeline-elegant .desc {
    font-weight: 300;
    font-size: 1.05rem;
    color: var(--text-dark);
}

/* Location and Gifts */
.location-section {
    text-align: center;
    margin-bottom: 80px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.gifts-section {
    text-align: center;
    margin-bottom: 80px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.location-address {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.map-frame-container {
    width: 100%;
    margin: 0 auto;
    max-width: 850px;
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(196, 183, 166, 0.2);
    box-shadow: 0 15px 40px rgba(0,0,0,0.03);
}

.map-route-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    z-index: 10;
    white-space: nowrap;
}

.map-route-btn:hover {
    background: var(--accent-dark);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Guestbook specific */
.guestbook-section {
    text-align: center;
    margin-bottom: 80px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    padding: 35px 40px 50px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.03);
    border: 1px solid rgba(196, 183, 166, 0.2);
}

.guestbook-desc {
    color: var(--text-dark);
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(196, 183, 166, 0.4);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: border-color 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 400px;
    padding-bottom: 50px;
}

.mic-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--bg-light);
    border: 1px solid rgba(196, 183, 166, 0.4);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px;
    z-index: 5;
}

.mic-btn svg {
    width: 20px;
    height: 20px;
}

.mic-btn:hover {
    background: var(--text-dark);
    color: #fff;
    border-color: var(--text-dark);
    transform: scale(1.05);
}

.mic-btn.recording {
    background: #ff4757;
    color: #fff;
    border-color: #ff4757;
    animation: pulseMic 1.5s infinite;
}

@keyframes pulseMic {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-dark);
}

/* Custom Radio Buttons for RSVP */
.rsvp-group {
    text-align: left;
    padding: 20px 20px 25px 20px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid rgba(196, 183, 166, 0.4);
    margin: 5px 0 10px 0;
}

.rsvp-question {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 500;
}

.radio-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-label {
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-dark);
    position: relative;
    padding-left: 35px;
    user-select: none;
    font-weight: 400;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-radio {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: var(--bg-light);
    border: 2px solid var(--accent);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.radio-label:hover input ~ .custom-radio {
    border-color: var(--accent-dark);
}

.radio-label input:checked ~ .custom-radio {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.custom-radio:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.radio-label input:checked ~ .custom-radio:after {
    display: block;
}

.submit-btn {
    padding: 15px;
    background-color: var(--text-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

.gifts-section {
    background: #fff;
    padding: 50px 40px 70px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.03);
    border: 1px solid rgba(196, 183, 166, 0.2);
    margin-bottom: 0;
}

.gifts-icon {
    margin-bottom: 20px;
}

.gifts-text {
    font-weight: 300;
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 30px;
}

.signature {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: var(--accent-dark);
    margin-top: 15px;
    transform: rotate(-4deg);
    display: inline-block;
    line-height: 1.2;
}

/* Animations */
.fadeIn {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    * {
        max-width: 100vw;
    }

    .invitation-container {
        overflow-x: hidden;
    }

    .invitation-container::after {
        display: none;
    }

    .bg-decor-1, .bg-decor-2 {
        display: none;
    }

    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        margin-top: 20px;
        min-height: auto;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 30px;
        order: 2; /* Move text below the image on mobile */
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
        padding: 0 10px;
    }

    .hero-image-wrapper {
        order: 1;
        width: 100%;
    }

    .main-title {
        font-size: 3rem; /* slightly smaller to fit narrow screens */
        word-wrap: break-word;
    }
    
    .age-badge {
        font-size: 5.5rem;
        font-weight: 500;
        margin-top: 15px;
        margin-bottom: 25px;
    }
    
    .age-badge::after {
        font-size: 1.5rem;
        right: -40px;
        bottom: 15px;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .photo-frame {
        max-width: 320px;
    }

    .program-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .program-grid::before {
        font-size: 6rem;
        top: -30px;
        left: 0;
        transform: rotate(-5deg);
        width: 100%;
        text-align: center;
    }
    
    .program-grid .program-day:nth-child(2) {
        margin-top: 0;
    }
    
    .program-day {
        padding: 30px 20px;
    }

    .section-heading {
        text-align: center;
        font-size: 2.2rem;
        margin-bottom: 30px;
    }
    
    .section-heading-small {
        font-size: 1.8rem;
    }

    .invitation-container {
        padding: 40px 15px;
    }
    
    .program-section, .location-section, .guestbook-section {
        margin-bottom: 40px; /* tighter spacing between cards */
    }
    
    .guestbook-section {
        padding: 30px 20px;
    }
    
    .gifts-section {
        padding: 30px 20px 50px 20px;
    }
    
    .rsvp-group {
        padding: 15px;
    }
    
    .signature {
        font-size: 2.5rem;
        white-space: pre-wrap;
        margin-top: 15px;
    }
    
    .map-frame-container {
        height: 300px;
    }
}
