:root {
    --color-cream: #D3D1B4;
    --color-olive: #2A362B;
    --color-light-olive: #707351;
    --color-gold: #A99F72;
    --color-sage: #A7C7A8;
    --color-dark: #1E261E;
}

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

html, body {
    min-height: 100%;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    min-height: 100vh;
    color: var(--color-cream);
    background: radial-gradient(circle at top, rgba(5, 10, 4, 0.14), rgba(2, 6, 2, 0.98) 45%), url("../assets/bg.jpg") center/cover no-repeat fixed;
    position: relative;
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08), transparent 28%), linear-gradient(180deg, rgba(12, 30, 12, 0.10), rgba(2, 6, 2, 0.72));
    pointer-events: none;
    z-index: 0;
}

.page-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(920px, 100%);
    padding: 22px 24px 0;
    z-index: 12;
    pointer-events: none;
}

.page-header nav {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
    flex-wrap: wrap;
    pointer-events: auto;
}

.page-header a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.page-header a:hover {
    color: var(--color-cream);
}

.page-container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    transition: transform 0.8s ease-in-out;
    position: relative;
    z-index: 1;
}

.section {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    position: relative;
}

.envelope-section {
    background: transparent;
    padding-top: 120px;
}

.envelope-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 15, 9, 0.14), rgba(1, 3, 1, 0.65));
    z-index: 0;
}

.envelope-wrapper {
    width: min(360px, 90vw);
    position: relative;
    perspective: 1200px;
    cursor: pointer;
    z-index: 2;
}

.envelope-stage {
    position: relative;
    display: flex;
    justify-content: center;
    width: min(420px, 90vw);
    padding: 32px 32px 24px;
    border-radius: 32px;
    background: rgba(14, 20, 11, 0.18);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.envelope {
    position: relative;
    width: 100%;
    overflow: visible;
}

.envelope-wrapper {
    width: 100%;
    position: relative;
    perspective: 1200px;
    cursor: pointer;
    z-index: 2;
}
.heart-card {
    width: 100%;
    display: block;
    position: absolute;
    top: -40px;
    left: 0;
    z-index: 1;
    border-radius: 24px;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.24);
    opacity: 0;
    transform: translateY(28px) scale(0.98);
    animation: revealHeart 1.4s ease forwards 0.4s;
}

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

.envelope-flaps {
    width: 100%;
    display: block;
    position: relative;
    z-index: 3;
    transform-origin: bottom center;
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
}

.envelope-wrapper.open .envelope-flaps {
    transform: rotateX(160deg) translateY(90px);
}

.envelope-label {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 4;
    width: 92%;
    color: var(--color-olive);
    pointer-events: none;
}


.envelope-label .calligraphy {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1;
    letter-spacing: 0.04em;
}

.envelope-label .date {
    margin-top: 0.65rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.open-envelope {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: none;
    background: transparent;
    color: var(--color-dark);
    padding: 16px 38.4px;
    border-radius: 999px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: none;
    cursor: pointer;
    z-index: 6;
    box-shadow: none;
    transition: transform 0.24s ease;
    width: 240px;
}

.open-envelope:hover {
    color: var(--color-dark);
    transform: translate(-50%, calc(-50% - 4px));
}

.save-the-date-details {
    background: transparent;
}

.ornate-border {
    width: min(520px, 90vw);
    padding: 40px 34px;
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.92);
    text-align: center;
    box-shadow: 0 28px 50px rgba(0,0,0,0.18);
}

.calligraphy {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1rem, 3vw, 3.2rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    margin-bottom: 0.75rem;
}

.accent-label {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--color-light-olive);
}

.date-time,
.location,
.note {
    margin: 0.8rem auto;
    color: var(--color-olive);
}

.date-time {
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.location {
    font-size: 1rem;
}

.note {
    max-width: 95%;
    font-size: 0.95rem;
    color: var(--color-olive);
}

.bow {
    width: 72px;
    margin-top: 1.8rem;
}

.section-cta {
    margin-top: 1.8rem;
    border: 1px solid var(--color-olive);
    background: transparent;
    color: var(--color-olive);
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.section-cta:hover {
    background: var(--color-olive);
    color: var(--color-cream);
}

.extended-details {
    background: linear-gradient(180deg, rgba(211,209,180,0.95), rgba(255,255,255,0.85));
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

.detail-block {
    width: min(620px, 90vw);
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(42,54,43,0.12);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.detail-block h4 {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    color: var(--color-olive);
}

.detail-block p,
.detail-block li {
    color: var(--color-olive);
    line-height: 1.7;
}

.program ul {
    list-style: none;
    display: grid;
    gap: 0.85rem;
}

.program li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.2rem;
}

.icon {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    border-radius: 50%;
    background: var(--color-gold);
}

.color-swatch {
    display: flex;
    gap: 0.55rem;
    margin-top: 1rem;
}

.swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(42,54,43,0.25);
}

.swatch.green { background: #A7C7A8; }
.swatch.olive { background: #707351; }
.swatch.dark-green { background: #2A362B; }
.swatch.cream { background: #D3D1B4; }

.footer-banner {
    width: min(620px, 90vw);
    min-height: 140px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(211,209,180,0.88), rgba(255,255,255,0.96));
    border: 1px solid rgba(42,54,43,0.12);
    box-shadow: 0 18px 36px rgba(0,0,0,0.12);
}

.footer-banner::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(81, 91, 71, 0.12), transparent 34%), radial-gradient(circle at 80% 70%, rgba(95, 108, 86, 0.12), transparent 30%);
    border-radius: inherit;
}

.rsvp-section {
    background: var(--color-dark);
    color: var(--color-cream);
    padding-bottom: 40px;
}

.rsvp-panel {
    width: min(520px, 90vw);
    padding: 32px;
    background: rgba(42,54,43,0.95);
    border-radius: 32px;
    box-shadow: 0 18px 36px rgba(0,0,0,0.17);
    text-align: center;
}

.rsvp-panel p {
    margin: 1rem auto 1.8rem;
    max-width: 85%;
    color: rgba(211,209,180,0.92);
}

.rsvp-panel form {
    display: grid;
    gap: 16px;
}

.rsvp-panel input[type="text"],
.rsvp-panel input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(211,209,180,0.12);
    border: 1px solid rgba(211,209,180,0.28);
    color: var(--color-cream);
    border-radius: 14px;
    font-size: 1rem;
}

.rsvp-panel input::placeholder {
    color: rgba(211,209,180,0.7);
}

.radio-group {
    display: grid;
    gap: 0.75rem;
    text-align: left;
    color: rgba(211,209,180,0.92);
}

.radio-group span {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--color-cream);
}

.rsvp-submit {
    background: var(--color-olive);
    color: var(--color-cream);
    border: none;
    border-radius: 999px;
    padding: 14px 0;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.3s ease;
}

.rsvp-submit:hover {
    background: var(--color-gold);
    color: var(--color-dark);
}

.page-container.show-section-2 {
    transform: translateY(-100vh);
}

.page-container.show-section-3 {
    transform: translateY(-200vh);
}

.page-container.show-section-4 {
    transform: translateY(-300vh);
}

@media screen and (min-width: 768px) {
    .section {
        padding: 40px;
    }

    .envelope-wrapper {
        width: min(420px, 70vw);
    }

    .ornate-border {
        width: min(600px, 80vw);
    }

    .detail-block {
        width: min(720px, 80vw);
    }

    .rsvp-panel {
        width: min(600px, 80vw);
    }
}

@media screen and (min-width: 1024px) {
    body {
        overflow-y: auto;
    }

    .page-container {
        width: min(920px, 95vw);
        margin: 0 auto;
        height: auto;
        overflow: visible;
        transform: none !important;
    }

    .section {
        min-height: auto;
        margin: 24px 0;
        border-radius: 28px;
        box-shadow: 0 18px 36px rgba(0,0,0,0.08);
    }

    .envelope-section,
    .save-the-date-details,
    .extended-details,
    .rsvp-section {
        padding: 60px 40px;
    }

    .open-envelope {
        bottom: -48px;
    }
}