* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #7b6656;
    --accent-color: #b7906d;
    --bg-color: #f7f3ee;
    --light-bg-color: #ece3d7;
    --text-color: #302923;
    --paper-shadow: rgba(48, 34, 23, 0.14);
    --seal-color: #a86e58;
    --font-heading: 'Cormorant Garamond', serif;
    --font-text: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-text);
    color: var(--text-color);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 35%),
        linear-gradient(180deg, #fbf7f1 0%, #f4ede5 100%);
    line-height: 1.6;
    overflow-x: hidden;
}

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

html {
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.section {
    padding: 80px 0;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.bg-light {
    background-color: var(--light-bg-color);
}

.title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-style: italic;
}

.text {
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.envelope-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    background:
        radial-gradient(circle at top, rgba(255, 244, 230, 0.22), transparent 30%),
        linear-gradient(160deg, rgba(30, 22, 20, 0.9), rgba(63, 45, 37, 0.82));
    overflow: hidden;
    perspective: 2000px;
    font-family: var(--font-heading);
}

.envelope-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Фото/IMG_8455.JPG');
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.32) saturate(0.8);
    transform: scale(1.08);
    z-index: 0;
}

.envelope-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(11, 8, 8, 0.1), rgba(11, 8, 8, 0.45)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 90px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 90px);
    z-index: 0;
}

.envelope-aura {
    position: absolute;
    width: min(72vw, 900px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(215, 186, 153, 0.28), transparent 62%);
    filter: blur(24px);
    z-index: 1;
}

.envelope-title-container {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #f8f1e8;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    opacity: 1;
    transition: opacity 0.8s ease;
}

.envelope-kicker {
    font-family: var(--font-text);
    font-size: 0.78rem;
    letter-spacing: 0.35rem;
    text-transform: uppercase;
    color: rgba(244, 230, 214, 0.75);
    margin-bottom: 16px;
}

.envelope-main-title {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 0.95;
    margin-bottom: 12px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.envelope-sub-title {
    font-family: var(--font-text);
    font-size: 0.95rem;
    letter-spacing: 0.08rem;
    color: rgba(248, 241, 232, 0.8);
}

.envelope {
    position: relative;
    width: min(78vw, 520px);
    aspect-ratio: 1.2 / 1;
    transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 10;
    filter: drop-shadow(0 42px 52px rgba(0, 0, 0, 0.38));
}

.envelope-back,
.envelope-front,
.envelope-side,
.envelope-top-wrapper {
    position: absolute;
    left: 0;
    width: 100%;
}

.envelope-back {
    inset: 0;
    background: linear-gradient(180deg, #efdfcc 0%, #ddc4aa 100%);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.envelope-top-wrapper {
    top: 0;
    height: 58%;
    z-index: 5;
    transform-origin: top;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}

.envelope-top {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #f8ebde 0%, #e4cbb0 100%);
    clip-path: polygon(0 0, 50% 92%, 100% 0);
    border-radius: 18px 18px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.envelope-top::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 45%);
    clip-path: polygon(0 0, 50% 92%, 100% 0);
}

.envelope-front {
    bottom: 0;
    height: 72%;
    background: linear-gradient(180deg, #e5cfb8 0%, #d8bea1 100%);
    clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
    z-index: 4;
    border-radius: 0 0 18px 18px;
    box-shadow: inset 0 18px 22px rgba(255, 255, 255, 0.14);
}

.envelope-side {
    bottom: 0;
    height: 72%;
    z-index: 3;
    background: linear-gradient(180deg, #e7d3bd 0%, #d7c0a7 100%);
}

.envelope-side-left {
    clip-path: polygon(0 0, 0 100%, 58% 100%, 100% 0);
}

.envelope-side-right {
    clip-path: polygon(0 0, 42% 100%, 100% 100%, 100% 0);
}

.envelope-paper {
    position: absolute;
    top: 20%;
    left: 50%;
    width: min(82%, 400px);
    height: 78%;
    transform: translateX(-50%);
    background:
        linear-gradient(180deg, rgb(255, 255, 255), rgb(255, 250, 242)),
        repeating-linear-gradient(0deg, rgba(143, 112, 88, 0.035) 0 1px, transparent 1px 40px);
    z-index: 3;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 42px 34px;
    text-align: center;
    border-radius: 18px;
    box-shadow:
        0 18px 30px var(--paper-shadow),
        inset 0 0 0 1px rgba(122, 94, 71, 0.08);
}

.paper-inner-border {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 1px solid rgba(123, 102, 86, 0.18);
    border-radius: 14px;
}

.paper-content {
    position: relative;
    z-index: 2;
    width: 100%;
    background: rgb(255, 250, 242);
    padding: 26px 18px;
}

.paper-eyebrow {
    font-size: 0.82rem;
    font-family: var(--font-text);
    letter-spacing: 0.28rem;
    text-transform: uppercase;
    color: rgba(123, 102, 86, 0.82);
    margin-bottom: 18px;
}

.paper-content h3 {
    font-size: clamp(2.15rem, 4.6vw, 3.45rem);
    color: var(--primary-color);
    margin-bottom: 14px;
    line-height: 0.96;
    font-weight: 500;
}

.paper-date {
    font-size: 0.85rem;
    font-family: var(--font-text);
    color: var(--text-color);
    letter-spacing: 0.18rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.envelope-seal {
    position: absolute;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 86px;
    height: 86px;
    border: 0;
    background: radial-gradient(circle at 30% 30%, #c68870 0%, var(--seal-color) 58%, #7f4f3e 100%);
    border-radius: 50%;
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow:
        0 16px 24px rgba(31, 18, 14, 0.32),
        inset 0 1px 3px rgba(255, 255, 255, 0.32),
        inset 0 -3px 8px rgba(64, 30, 18, 0.36);
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}

.envelope-seal:hover {
    transform: translate(-50%, -52%) scale(1.04);
    box-shadow:
        0 22px 30px rgba(31, 18, 14, 0.36),
        inset 0 1px 3px rgba(255, 255, 255, 0.4),
        inset 0 -3px 8px rgba(64, 30, 18, 0.36);
}

.seal-inner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 1px solid rgba(255, 243, 233, 0.34);
    background: radial-gradient(circle at 35% 30%, rgba(255, 210, 190, 0.24), transparent 38%);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(58, 26, 17, 0.22);
}

.seal-text {
    color: #f8e8da;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
    line-height: 1;
}

.envelope-wrapper.opened .envelope-title-container {
    opacity: 0;
}

.envelope-wrapper.opened .envelope-top-wrapper {
    transform: rotateX(182deg);
    z-index: 1;
}

.envelope-wrapper.opened .envelope {
    transform: translateY(20%);
}

.envelope-wrapper.opened .envelope-paper {
    transform: translateX(-50%) translateY(-69%) scale(1.015);
    transition-delay: 0.08s;
}

.envelope-wrapper.opened .envelope-seal {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.82);
    pointer-events: none;
}

.envelope-wrapper.out {
    transform: translateY(100vh) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

@media(max-width: 480px) {
    .envelope-wrapper {
        gap: 24px;
        padding: 24px 18px;
    }

    .envelope {
        width: 100%;
    }

    .envelope-main-title {
        font-size: 2.6rem;
    }

    .envelope-sub-title,
    .envelope-kicker,
    .paper-date,
    .paper-eyebrow {
        letter-spacing: 0.16rem;
    }

    .envelope-paper {
        padding: 34px 22px;
    }

    .paper-content {
        padding: 20px 10px;
    }
}



.btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #fff;
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background-color: var(--accent-color);
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    position: relative;
    padding: 0;
    opacity: 1;
    transform: none;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('Фото/IMG_8455.JPG');
    background-position: center 30%;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.hero-content {
    text-align: center;
    z-index: 1;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-style: italic;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 10px;
}

.hero-title .amp {
    font-size: 3rem;
    color: var(--accent-color);
    font-style: italic;
}

.hero-date {
    font-family: var(--font-text);
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.welcome-photo-placeholder {
    width: 100%;
    max-width: 500px;
    height: 500px;
    background: url('Фото/IMG_8465.JPG') center/cover;
    margin: 40px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.welcome-photo-placeholder span {
    display: none;
}

.date-big {
    font-size: 3.5rem;
    margin-bottom: 0;
}

.subtitle-small {
    font-family: var(--font-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 40px;
    color: #666;
}

.calendar-wrapper {
    max-width: 350px;
    margin: 0 auto;
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-text);
}

.calendar th {
    padding: 10px;
    font-weight: 500;
    color: var(--primary-color);
    border-bottom: 1px solid #ddd;
}

.calendar td {
    padding: 15px 10px;
    text-align: center;
    color: var(--text-color);
}

.calendar td.weekend,
.calendar th.weekend {
    color: #aaa;
}

.target-date {
    position: relative;
}

.target-date span {
    position: relative;
    z-index: 1;
    color: #fff;
}

.target-date::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    z-index: 0;
}

.venue-name {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.venue .text {
    color: var(--primary-color);
}

.venue-additional {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #888;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.venue .btn {
    margin-top: 30px;
}

.timeline {
    position: relative;
    max-width: 400px;
    margin: 40px auto 0;
    text-align: left;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 100px;
    height: 100%;
    width: 1px;
    background: var(--primary-color);
}

.timeline-item {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.timeline-item .time {
    width: 100px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    padding-right: 20px;
    text-align: right;
    position: relative;
}

.timeline-item .time::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    z-index: 1;
}

.timeline-item .content {
    width: calc(100% - 100px);
    padding-left: 30px;
}

.timeline-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.timeline-item p {
    font-size: 0.85rem;
    color: #555;
}

.palette-title {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 500;
}

.palette {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.color-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bg-color-1 {
    background-color: #9F8170;
}

.bg-color-2 {
    background-color: #8B6D5C;
}

.bg-color-3 {
    background-color: #785840;
}

.bg-color-4 {
    background-color: #79553D;
}

.bg-color-5 {
    background-color: #654321;
}

.dresscode-rules ul {
    list-style: none;
    margin-top: 15px;
    margin-bottom: 20px;
}

.dresscode-rules li {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #666;
}

.dresscode-rules .important {
    font-weight: 500;
    color: var(--primary-color);
    font-style: italic;
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

.rsvp-form {
    text-align: left;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-text);
    font-size: 0.9rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.radio-group .radio-label,
.checkbox-group .chk-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 300;
    cursor: pointer;
}

.radio-group input,
.checkbox-group input {
    margin-right: 10px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-submit {
    width: 100%;
    margin-top: 10px;
}

.organizer-info {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    font-size: 0.9rem;
}

.org-contacts a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.countdown-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

.timer {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.timer-box {
    background: #fff;
    padding: 20px;
    min-width: 90px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.timer-box span {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    line-height: 1;
}

.timer-box p {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    color: #888;
}

.mt-lg {
    margin-top: 40px;
}

@media(max-width: 600px) {
    .title {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        flex-direction: column;
    }

    .timeline-item .time {
        width: 100%;
        text-align: left;
        padding-left: 20px;
        margin-bottom: 5px;
    }

    .timeline-item .time::after {
        left: -7px;
        right: auto;
        top: 8px;
    }

    .timeline-item .content {
        width: 100%;
        padding-left: 20px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .timer {
        flex-wrap: wrap;
    }

    .timer-box {
        width: 45%;
    }

}

.scroll-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.scroll-dot {
    width: 6px;
    height: 6px;
    border-radius: 6px;
    background-color: rgba(140, 124, 109, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-dot:hover {
    background-color: var(--primary-color);
}

.scroll-dot.active {
    height: 30px;
    background-color: var(--primary-color);
}

@media(max-width: 768px) {
    .scroll-indicator {
        right: 10px;
        gap: 8px;
    }

    .scroll-dot {
        width: 5px;
        height: 5px;
    }

    .scroll-dot.active {
        height: 20px;
    }
}
