:root {
    --bg-cream: #f8f3ec;
    --bg-soft-pink: #f9eef0;
    --champagne: #e8d8c3;
    --gold: #b6925e;
    --text-dark: #3b2f2f;
    --text-muted: #675a5a;
    --card: #fffdf9;
    --shadow: 0 16px 40px rgba(102, 76, 54, 0.16);
    --radius-lg: 24px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    font-family: "Inter", sans-serif;
    color: var(--text-dark);
    background:
        linear-gradient(rgba(246, 239, 231, 0.78), rgba(230, 216, 213, 0.82)),
        url("../img/background.png"),
        radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.6), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(247, 214, 224, 0.52), transparent 34%),
        radial-gradient(circle at 20% 82%, rgba(236, 218, 196, 0.48), transparent 36%),
        linear-gradient(160deg, #f6efe7, #efe3df 50%, #e6d8d5);
    background-attachment: fixed;
    background-size: cover, cover, auto, auto, auto, auto;
    background-position: center, center, center, center, center, center;
}

/* Lock scroll while the envelope intro is visible. */
body.locked {
    overflow: hidden;
    height: 100vh;
}

h1,
h2,
.location-content h3,
.signature {
    font-family: "Playfair Display", serif;
    letter-spacing: 0.03em;
}

.scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 4px;
    z-index: 35;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

#scroll-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #f3d8a6, #bb8f56);
    box-shadow: 0 0 14px rgba(187, 143, 86, 0.5);
    transition: width 0.15s linear;
}

.envelope-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background:
        linear-gradient(rgba(246, 239, 231, 0.78), rgba(230, 216, 213, 0.82)),
        url("../img/background.png"),
        radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.6), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(247, 214, 224, 0.52), transparent 34%),
        radial-gradient(circle at 20% 82%, rgba(236, 218, 196, 0.48), transparent 36%),
        linear-gradient(160deg, #f6efe7, #efe3df 50%, #e6d8d5);
    background-attachment: fixed;
    background-size: cover, cover, auto, auto, auto, auto;
    background-position: center, center, center, center, center, center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

.envelope-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.038) 0 1px, rgba(180, 166, 140, 0.03) 1px 3px),
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.12), transparent 28%),
        radial-gradient(circle at 82% 84%, rgba(129, 114, 88, 0.06), transparent 35%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

.envelope-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope-container {
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    position: relative;
    z-index: 3;
}

.envelope-container:focus-visible {
    outline: 2px solid rgba(183, 136, 86, 0.6);
    outline-offset: 8px;
}

.envelope {
    position: relative;
    width: min(88vw, 430px);
    aspect-ratio: 1.18 / 1;
    filter: drop-shadow(0 24px 38px rgba(45, 54, 38, 0.38));
    transform-style: preserve-3d;
    transition: transform 0.4s ease, filter 0.4s ease;
    transform: perspective(1200px) rotateX(2deg) rotateZ(-0.6deg);
}

.envelope::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: -10%;
    height: 46%;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(255, 248, 235, 0.58), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.envelope-back,
.envelope-flap,
.envelope-front {
    position: absolute;
    left: 0;
    width: 100%;
    border-radius: 8px;
}

.envelope-back {
    bottom: 0;
    background:
        repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.02) 0 2px, rgba(56, 76, 51, 0.045) 2px 4px),
        linear-gradient(180deg, rgba(128, 149, 116, 0.5), rgba(111, 132, 100, 0.68)),
        linear-gradient(165deg, #8ca487, #6f8664);
    border: 1px solid rgba(84, 103, 75, 0.56);
}

.envelope-flap {
    top: 35%;
    left: 0;
    width: 100%;
    height: 56%;
    transform-origin: top;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.08rem;
    padding-top: 0.65rem;
    background:
        repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.03) 0 2px, rgba(53, 75, 49, 0.045) 2px 4px),
        radial-gradient(circle at 50% 10%, rgba(164, 184, 151, 0.8), transparent 52%),
        linear-gradient(180deg, #9ab191, #7d9773);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    border: 1px solid rgba(84, 103, 75, 0.55);
    transition: transform 1.05s cubic-bezier(0.25, 0.82, 0.25, 1);
    z-index: 6;
    box-shadow: inset 0 -22px 28px rgba(64, 82, 58, 0.35);
}

.envelope-flap::before {
    content: "";
    position: absolute;
    inset: 14% 16% 23%;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.22), transparent 52%),
        radial-gradient(circle at 26% 48%, rgba(58, 74, 53, 0.18) 0 9%, transparent 10%),
        radial-gradient(circle at 74% 48%, rgba(58, 74, 53, 0.18) 0 9%, transparent 10%),
        radial-gradient(circle at 50% 62%, rgba(58, 74, 53, 0.16) 0 11%, transparent 12%);
    opacity: 0.75;
    filter: blur(0.2px);
    pointer-events: none;
}

.envelope-flap::after {
    content: "";
    position: absolute;
    inset: 13% 15% 22%;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    background:
        radial-gradient(circle at 28% 46%, rgba(228, 236, 218, 0.35), transparent 14%),
        radial-gradient(circle at 72% 46%, rgba(228, 236, 218, 0.35), transparent 14%),
        radial-gradient(circle at 50% 60%, rgba(228, 236, 218, 0.3), transparent 16%);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

.flap-title {
    font-family: "Playfair Display", serif;
    font-size: 0.77rem;
    color: #33402e;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
    text-shadow: 0 1px 0 rgba(232, 240, 222, 0.35);
}

.flap-subtitle {
    font-family: "Great Vibes", cursive;
    font-size: 2.12rem;
    font-weight: 400;
    color: #2d3929;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(232, 240, 222, 0.3);
}

.envelope-front {
    bottom: 0;
    height: 64%;
    background:
        repeating-linear-gradient(35deg, rgba(255, 255, 255, 0.02) 0 2px, rgba(56, 76, 51, 0.045) 2px 4px),
        linear-gradient(180deg, rgba(111, 132, 100, 0.72), rgba(100, 120, 90, 0.95)),
        linear-gradient(45deg, #819876, #6a8160);
    border: 1px solid rgba(84, 103, 75, 0.56);
    z-index: 2;
}

.envelope-letter-preview {
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 9%;
    height: 76%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0.9rem 1rem;
    background: #eff2e8;
    border-radius: 6px 6px 3px 3px;
    border: 1px solid rgba(84, 103, 75, 0.35);
    transform: translateY(42%);
    opacity: 0;
    transition: transform 1.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.45s ease;
    z-index: 1;
    overflow: hidden;
}

.preview-photo {
    width: min(100%, 245px);
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(84, 103, 75, 0.24);
    margin-bottom: 0.5rem;
}

.envelope-seal {
    position: absolute;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    isolation: isolate;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 245, 218, 0.95) 0 14%, rgba(248, 211, 132, 0.97) 25%, rgba(196, 129, 58, 0.96) 63%, rgba(132, 82, 36, 0.98) 100%),
        conic-gradient(from 208deg, #9d612d, #f4d38f, #ab6b32, #f1c570, #8f5428, #9d612d);
    border-radius: 57% 43% 51% 49% / 47% 54% 46% 53%;
    clip-path: polygon(8% 20%, 13% 10%, 24% 5%, 37% 4%, 49% 7%, 61% 4%, 73% 7%, 84% 12%, 92% 22%, 96% 35%, 94% 47%, 97% 60%, 93% 73%, 84% 84%, 73% 91%, 59% 95%, 45% 97%, 32% 94%, 20% 89%, 11% 79%, 6% 68%, 4% 55%, 5% 42%);
    left: calc(50% - 34px);
    top: 81%; 
    transform: translateY(-50%);
    z-index: 7;
    border: 1.6px solid rgba(250, 224, 165, 0.45);
    box-shadow:
        0 10px 18px rgba(72, 49, 22, 0.38),
        0 2px 0 rgba(255, 236, 194, 0.32),
        inset 0 2px 5px rgba(255, 242, 208, 0.62),
        inset 0 -7px 11px rgba(96, 56, 24, 0.4);
    transition: opacity 0.45s ease, transform 0.6s ease;
}

.envelope-seal::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 51% 49% 47% 53% / 50% 52% 48% 50%;
    border: 1px solid rgba(247, 223, 170, 0.38);
    box-shadow:
        inset 0 2px 3px rgba(255, 241, 208, 0.32),
        inset 0 -3px 4px rgba(111, 66, 30, 0.22);
    z-index: -1;
}

.envelope-seal::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 25% 22%, rgba(255, 255, 255, 0.5), transparent 35%),
        radial-gradient(circle at 78% 80%, rgba(82, 45, 21, 0.25), transparent 40%);
    pointer-events: none;
}

.envelope-seal span {
    position: relative;
    font-family: "Playfair Display", serif;
    font-weight: 600;
    color: #6a4524;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-shadow:
        0 1px 0 rgba(246, 223, 177, 0.25),
        0 -1px 0 rgba(102, 58, 25, 0.38),
        0 -2px 0 rgba(99, 54, 23, 0.22);
}

.envelope-seal span::before,
.envelope-seal span::after {
    position: absolute;
    top: 50%;
    transform: translateY(-55%);
    font-size: 0.46rem;
    color: rgba(114, 71, 35, 0.75);
    letter-spacing: 0;
}

.envelope-seal span::before {
    content: "o";
    left: -8px;
}

.envelope-seal span::after {
    content: "o";
    right: -8px;
}

.letter-preview-text {
    font-family: "Great Vibes", cursive;
    font-size: clamp(1.4rem, 5.2vw, 2.3rem);
    color: #5b6f52;
    line-height: 1.1;
}

.letter-preview-subtitle {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: #56664d;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.envelope-cta {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    color: rgba(73, 83, 66, 0.8);
    font-size: clamp(0.82rem, 2.8vw, 1rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(239, 235, 219, 0.65);
    animation: ctaPulse 2.8s ease-in-out infinite;
}

/* Play opening sequence after click. */
.envelope-overlay.opened .envelope-flap {
    transform: rotateX(-170deg);
}

.envelope-overlay.opened .envelope-letter-preview {
    transform: translateY(-46%);
    opacity: 1;
    z-index: 8;
}

.envelope-overlay.opened .envelope-seal {
    opacity: 0;
    transform: translateY(-40%) scale(0.8);
}

.envelope-overlay.opened .envelope-front {
    box-shadow: inset 0 10px 16px rgba(62, 79, 56, 0.25);
}

.overlay-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 42%, rgba(72, 82, 64, 0.24) 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 60%);
    z-index: 1;
}

.sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.25;
}

.sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(239, 245, 229, 0.9), rgba(177, 193, 156, 0.2));
    box-shadow: 0 0 10px rgba(181, 201, 157, 0.5);
    animation: sparkleFloat 4.8s ease-in-out infinite;
    opacity: 0.75;
}

.sparkle.s1 { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle.s2 { top: 30%; right: 18%; animation-delay: 0.6s; }
.sparkle.s3 { top: 62%; left: 14%; animation-delay: 1.1s; }
.sparkle.s4 { top: 70%; right: 16%; animation-delay: 1.8s; }
.sparkle.s5 { top: 14%; left: 62%; animation-delay: 2.2s; }
.sparkle.s6 { top: 82%; left: 56%; animation-delay: 2.8s; }

.invitation-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 7rem 1.1rem 4rem;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.invitation-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.section {
    background: var(--card);
    border: 1px solid rgba(182, 146, 94, 0.17);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(1.5rem, 4vw, 2.9rem);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.section-has-video-bg > :not(.section-video-bg) {
    position: relative;
    z-index: 2;
}

.section-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.section-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: saturate(0.82) contrast(0.9) brightness(0.88);
}

.section-video-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(252, 248, 242, 0.87), rgba(247, 238, 228, 0.84)),
        radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(circle at 12% 90%, rgba(234, 214, 196, 0.22), transparent 45%);
}

/* Scroll reveal: elements animate in as they enter viewport. */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(34px) scale(0.985);
    filter: blur(3px);
    transition:
        opacity 0.7s ease,
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.7s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform, filter;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.hero {
    text-align: center;
    padding-top: clamp(2rem, 6vw, 4rem);
    padding-bottom: clamp(2rem, 6vw, 4rem);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 244, 231, 0.9), transparent 38%),
        radial-gradient(circle at bottom left, rgba(242, 225, 227, 0.66), transparent 36%),
        var(--card);
}

.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-video-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1.08);
    border: 0;
    object-fit: cover;
    filter: saturate(0.9) contrast(0.9) brightness(0.9);
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(248, 242, 234, 0.78), rgba(242, 232, 223, 0.8)),
        radial-gradient(circle at top right, rgba(255, 247, 235, 0.5), transparent 42%),
        radial-gradient(circle at bottom left, rgba(241, 223, 225, 0.45), transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 3;
}

.parallax-ornament {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    will-change: transform;
}

.ornament-a {
    width: 220px;
    height: 220px;
    right: -60px;
    top: -30px;
    background: radial-gradient(circle, rgba(245, 218, 186, 0.35), transparent 66%);
}

.ornament-b {
    width: 180px;
    height: 180px;
    left: -50px;
    bottom: -40px;
    background: radial-gradient(circle, rgba(239, 207, 220, 0.33), transparent 66%);
}

.hero-photo {
    width: min(100%, 760px);
    max-height: min(52vh, 430px);
    object-fit: cover;
    border-radius: 18px;
    margin: 0 auto 1.2rem;
    display: block;
    border: 1px solid rgba(182, 146, 94, 0.28);
    box-shadow: 0 14px 30px rgba(80, 57, 36, 0.18);
}

.scroll-indicator {
    margin-top: 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #8d7368;
    font-size: 0.9rem;
}

.scroll-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #efd5aa, #c69862);
    animation: pulseDot 1.5s ease-in-out infinite;
}

.eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

h1 {
    margin: 0.2rem 0 0.8rem;
    font-size: clamp(2rem, 8vw, 4rem);
}

h2 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: clamp(1.7rem, 5vw, 2.2rem);
}

p {
    line-height: 1.75;
    margin: 0.3rem 0;
}

.hero-message {
    max-width: 50ch;
    margin: 0 auto;
    color: var(--text-muted);
}

.countdown-wrap {
    margin: 1.2rem 0 0;
}

.countdown-label {
    color: #8b7568;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 0.85rem;
}

.count-card {
    padding: 1.05rem 0.5rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(251, 243, 233, 0.92));
    border: 1px solid rgba(226, 198, 162, 0.55);
    box-shadow: 0 10px 22px rgba(110, 76, 42, 0.14);
    text-align: center;
    backdrop-filter: blur(7px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.count-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 26px rgba(110, 76, 42, 0.18);
}

.count-card strong {
    display: block;
    font-size: clamp(1.35rem, 4vw, 2rem);
    color: #8a603c;
    line-height: 1;
}

.count-card span {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #866f63;
    letter-spacing: 0.09em;
    margin-top: 0.25rem;
    display: block;
}

.date-section {
    padding-top: clamp(2rem, 5vw, 3rem);
    padding-bottom: clamp(2rem, 5vw, 3rem);
    background:
        radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.7), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(252, 247, 241, 0.92));
}

.date-hero {
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
    padding: 1rem 1rem 1.2rem;
    border-top: 1px solid rgba(191, 150, 102, 0.28);
    border-bottom: 1px solid rgba(191, 150, 102, 0.28);
}

.date-highlight {
    margin-top: 0;
    margin-bottom: 0.15rem;
    text-align: center;
    font-family: "Playfair Display", serif;
    font-size: clamp(1.7rem, 4.5vw, 2.5rem);
    color: #6f543d;
    letter-spacing: 0.03em;
    font-weight: 600;
    line-height: 1.2;
}

.date-subline {
    margin: 0;
    color: #9a8578;
    font-size: 0.96rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}

.location-card {
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(245, 220, 180, 0.6);
    box-shadow: 0 16px 28px rgba(116, 85, 56, 0.16);
}

.location-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.location-content {
    padding: 0.9rem;
}

.location-content h3 {
    margin: 0.1rem 0 0.5rem;
    font-size: 1.2rem;
}

.location-address {
    margin: 0 0 0.35rem;
    color: #846d60;
    font-size: 0.95rem;
}

.map-btn span {
    margin-right: 0.3rem;
}

.timeline {
    position: relative;
    margin-top: 0.8rem;
    display: grid;
    gap: 1.2rem;
    padding-left: 1.3rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 0.26rem;
    top: 0.4rem;
    bottom: 0.4rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(193, 150, 95, 0.3), rgba(193, 150, 95, 0.95), rgba(193, 150, 95, 0.2));
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.timeline-marker {
    width: 12px;
    min-width: 12px;
    height: 12px;
    margin-top: 0.47rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #efc98e, #b58a56);
    box-shadow: 0 0 0 4px rgba(239, 201, 142, 0.2);
}

.timeline-item p {
    margin: 0;
    line-height: 1.8;
}

.timeline-time {
    font-weight: 700;
    color: #8b6440;
    margin-right: 0.45rem;
}

.sticky-location-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 12;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #ba8f5e, #94673f);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    box-shadow: 0 14px 28px rgba(100, 66, 36, 0.3);
    font-weight: 600;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sticky-location-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px rgba(100, 66, 36, 0.35);
}

.music-toggle-btn {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 12;
    border: 1px solid rgba(182, 146, 94, 0.45);
    color: #5a4639;
    background: rgba(255, 251, 245, 0.88);
    backdrop-filter: blur(8px);
    padding: 0.66rem 0.95rem;
    border-radius: 999px;
    box-shadow: 0 14px 28px rgba(100, 66, 36, 0.2);
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.music-toggle-btn:hover,
.music-toggle-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(100, 66, 36, 0.24);
}

.music-toggle-btn.is-muted {
    background: rgba(245, 238, 230, 0.9);
    color: #8c7360;
}

.btn {
    display: inline-block;
    margin-top: 0.9rem;
    padding: 0.7rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #b6925e, #9f7c4d);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(122, 90, 57, 0.3);
}

.btn-outline {
    background: transparent;
    color: #8f6a44;
    border: 1px solid rgba(182, 146, 94, 0.6);
}

.btn-outline[aria-disabled="true"] {
    opacity: 0.75;
}

.rsvp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.closing {
    text-align: center;
}

.signature {
    margin-top: 0.7rem;
    color: var(--gold);
    font-size: clamp(1.6rem, 5vw, 2rem);
}

/* Keep animations subtle for users that prefer reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .envelope {
        animation: floatEnvelope 3.6s ease-in-out infinite;
    }

    .envelope-container:hover .envelope {
        transform: translateY(-6px) scale(1.02);
        filter: drop-shadow(0 30px 56px rgba(89, 62, 35, 0.34));
    }

    .envelope-container:hover .envelope-seal {
        transform: translateY(-50%) scale(1.05);
        box-shadow: 0 16px 26px rgba(113, 54, 70, 0.3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .reveal-on-scroll.is-visible {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .section { transform: none; }

    .sparkle,
    .envelope-cta,
    .envelope,
    .envelope-container:hover .envelope {
        animation: none;
    }
}

/* Tablet and desktop spacing refinements. */
@media (min-width: 768px) {
    .section {
        margin-bottom: 2.3rem;
    }

    .details p {
        font-size: 1.04rem;
    }
}

/* Mobile-first optimization for easier reading and tapping. */
@media (max-width: 480px) {
    .invitation-content {
        padding-top: 5rem;
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .envelope {
        width: min(90vw, 390px);
    }

    .preview-photo {
        height: 112px;
    }

    .flap-title {
        font-size: 0.63rem;
    }

    .flap-subtitle {
        font-size: 1.9rem; 
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .rsvp-actions {
        flex-direction: column;
    }

    .countdown {
        grid-template-columns: repeat(2, minmax(70px, 1fr));
    }

    .date-subline {
        letter-spacing: 0.08em;
        font-size: 0.85rem;
    }

    .sticky-location-btn {
        right: 0.7rem;
        bottom: 0.7rem;
        font-size: 0.92rem;
    }

    .music-toggle-btn {
        left: 0.7rem;
        bottom: 0.7rem;
        font-size: 0.9rem;
    }
}

@keyframes floatEnvelope {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulseDot {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

@keyframes parallaxFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

@keyframes sparkleFloat {
    0%,
    100% {
        transform: translateY(0) scale(0.9);
        opacity: 0.55;
    }
    50% {
        transform: translateY(-10px) scale(1.08);
        opacity: 1;
    }
}

@keyframes ctaPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.03);
        opacity: 1;
    }
}
