/* =========================================================
   RESET & BASE
   ========================================================= */
* {
    box-sizing: border-box;
}

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

body {
    background-color: #F4EDE1;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================================
   GENERIC SECTIONS / IMAGES
   ========================================================= */
.section {
    width: 100%;
    max-width: 100%;
}

.responsive-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* =========================================================
   ENVELOPE INTRO OVERLAY
   ========================================================= */
.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4ede1;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    transition: opacity .6s ease, visibility .6s ease;
}

.intro-overlay.hide {
    animation: introFadeOut .7s ease forwards;
    pointer-events: none;
}

@keyframes introFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.envelope-button {
    width: 100%;
    max-width: 430px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.75rem, 3vh, 1.25rem);
    cursor: pointer;
    animation: envelopeFloat 2.5s ease-in-out infinite;
    transition: transform .25s ease, opacity .35s ease;
}

.envelope-button:hover {
    transform: scale(1.05);
}

@keyframes envelopeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.envelope-image {
    width: min(86vw, 320px);
    max-height: 70dvh;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .16));
}

.tap-text {
    margin: 0;
    max-width: 90vw;
    text-align: center;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(0.65rem, 2.8vw, 0.85rem);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6b4d3d;
    text-decoration: underline;
    text-decoration-color: #37491d;
    text-underline-offset: 4px;
}

/* Intro video plays full-screen inside the overlay once tapped */
.intro-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.hidden {
    display: none !important;
}

.tap-play-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.6rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #3D2B1F;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(0.8rem, 3.5vw, 0.95rem);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.tap-play-btn.hidden {
    display: none !important;
}

/* =========================================================
   SECTION 2 — SCRATCH CARD REVEAL
   ========================================================= */
.section-2 {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-height: auto;
    gap: clamp(1rem, 4vw, 1.5rem);
    padding: clamp(2rem, 7vw, 4rem) 0.75rem 2.5rem;
    background: #f4efe4;
}

.section-2 h2 {
    margin: 0;
    color: #3D521E;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.8rem, 8vw, 3.5rem);
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
}

.floral-decorations {
    display: none;
}

.scratch-row {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.4rem, 2.5vw, 1rem);
    width: min(100%, 25rem);
    margin: 0 auto;
    padding-inline: clamp(0rem, 2vw, 0.5rem);
}

.scratch-card {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 0.74;
    background: #FBF6E9;
    border-radius: 0.75rem;
    border: 0.5px solid rgba(184, 150, 90, 0.3);
    box-shadow: 0 6px 16px rgba(141, 110, 99, 0.18);
    overflow: hidden;
    user-select: none;
}

.scratch-card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(0.3rem, 2vw, 0.5rem);
    text-align: center;
    background: #FFFDF7;
    opacity: 0;
    transition: opacity 700ms ease-in-out;
}

.scratch-card.revealed .scratch-card-face {
    opacity: 1;
}

.scratch-card-inset {
    position: absolute;
    border-radius: 0.5rem;
    pointer-events: none;
}

.scratch-card-inset-1 {
    inset: 6px;
    border: 0.5px solid rgba(184, 150, 90, 0.1);
}

.scratch-card-inset-2 {
    inset: 8px;
    border: 0.5px solid rgba(184, 150, 90, 0.2);
}

.scratch-card-label {
    font-family: "Montserrat", sans-serif;
    color: #8F7240;
    font-size: clamp(7px, 1.8vw, 8px);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.25rem;
}

.scratch-card-value {
    margin: 0;
    font-family: "Playfair Display", serif;
    color: #3D2B1F;
    font-size: clamp(0.95rem, 6vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.scratch-card-subvalue {
    font-family: "Montserrat", sans-serif;
    color: rgba(61, 43, 31, 0.7);
    font-size: clamp(6px, 1.6vw, 7px);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.35rem;
    line-height: 1;
}

.scratch-card-canvas {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.scratch-card-canvas.scratching {
    cursor: grabbing;
}

.scratch-card-canvas.revealed {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    transition: opacity 700ms ease-in-out, transform 700ms ease-in-out;
}

.scratch-status {
    position: relative;
    z-index: 2;
    min-height: 3rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding-inline: 0.5rem;
}

.scratch-instructions,
.scratch-success {
    transition: opacity 400ms ease-in-out;
}

.scratch-instructions {
    margin: 0;
    max-width: 280px;
    font-family: "Montserrat", sans-serif;
    color: rgba(61, 43, 31, 0.6);
    font-size: clamp(9px, 2.2vw, 10px);
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.6;
}

.scratch-instructions[hidden],
.scratch-success[hidden] {
    display: none;
}

.scratch-success h3 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    color: #B5952F;
    font-size: clamp(0.8rem, 3.5vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.scratch-success p {
    margin: 0.5rem 0 0;
    font-family: "Montserrat", sans-serif;
    color: rgba(61, 43, 31, 0.9);
    font-size: clamp(8px, 2vw, 9px);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* =========================================================
   SECTION — WEDDING COUNTDOWN
   ========================================================= */
.section-countdown {
    display: flex;
    justify-content: center;
    width: 100%;
    background: #f4efe4;
    padding: clamp(2rem, 7vw, 3.5rem) 1rem;
}

.countdown-card {
    width: 100%;
    max-width: 960px;
    text-align: center;
    background: #FBF6E9;
    border: 1px solid rgba(184, 150, 90, 0.3);
    border-radius: 1.5rem;
    box-shadow: 0 14px 32px rgba(141, 110, 99, 0.15);
    padding: clamp(2rem, 6vw, 3rem) clamp(1rem, 5vw, 3rem);
}

.countdown-eyebrow {
    margin: 0 0 clamp(1.75rem, 6vw, 2.75rem);
    font-family: "Montserrat", sans-serif;
    font-size: clamp(10px, 2.4vw, 13px);
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #B5952F;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(0.6rem, 3vw, 1.5rem);
    max-width: 720px;
    margin: 0 auto;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.65rem, 2.5vw, 1rem);
}

.countdown-value {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #FFFDF7 0%, #F7EFDD 100%);
    border: 0.5px solid rgba(184, 150, 90, 0.35);
    border-radius: 0.85rem;
    font-family: "Playfair Display", serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 6vw, 2.75rem);
    color: #3D2B1F;
    box-shadow: 0 10px 20px rgba(141, 110, 99, 0.18);
}

.countdown-label {
    font-family: "Montserrat", sans-serif;
    font-size: clamp(8px, 2.2vw, 11px);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(61, 43, 31, 0.65);
}

.countdown-divider {
    margin-top: clamp(1.75rem, 6vw, 2.75rem);
    height: 1px;
    background: rgba(184, 150, 90, 0.3);
}

/* =========================================================
   SECTION — PHOTO MEMORIES CAROUSEL
   ========================================================= */
.section-glimpse {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: clamp(2.5rem, 8vw, 4.5rem) 1rem clamp(2rem, 6vw, 3rem);
    background: #f4efe4;
    text-align: center;
    overflow: hidden;
}

.glimpse-eyebrow {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(9px, 2.2vw, 10px);
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #8F7240;
    margin-bottom: 0.5rem;
}

.glimpse-title {
    margin: 0 0 clamp(1.5rem, 5vw, 2.25rem);
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 600;
    line-height: 1.1;
    font-size: clamp(1.9rem, 8vw, 3rem);
    color: #3D521E;
}

.card-stage {
    position: relative;
    width: min(78vw, 260px);
    height: min(102vw, 340px);
    margin: 0 auto;
}

.polaroid {
    position: absolute;
    inset: 0;
    background: #FFFDF7;
    border: 0.5px solid rgba(184, 150, 90, 0.35);
    border-radius: 0.9rem;
    padding: 10px;
    box-shadow: 0 16px 32px -10px rgba(61, 43, 31, 0.28);
    opacity: 0;
    transform: rotate(-6deg) scale(0.96);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

.polaroid.active {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    pointer-events: auto;
    z-index: 2;
}

.polaroid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.6rem;
    display: block;
}

.glimpse-caption {
    margin: clamp(1.1rem, 4vw, 1.5rem) 0 0;
    font-family: "Montserrat", sans-serif;
    font-style: italic;
    font-size: clamp(11px, 2.6vw, 13px);
    letter-spacing: 0.3px;
    color: rgba(61, 43, 31, 0.7);
}

.glimpse-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.glimpse-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #B5952F;
    opacity: 0.35;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.glimpse-dots span.active {
    opacity: 1;
    transform: scale(1.3);
}

@media (max-width: 600px) {
    .card-stage {
        width: 72vw;
        height: 94vw;
        max-height: 320px;
    }
}

/* =========================================================
   CONFETTI & FALLING FLOWERS
   ========================================================= */
.confetti-piece {
    position: fixed;
    top: -20px;
    left: var(--left);
    z-index: 100;
    width: var(--size);
    height: calc(var(--size) * 1.6);
    opacity: 0;
    pointer-events: none;
    border-radius: 2px;
    animation: pink-confetti-fall 2.4s cubic-bezier(0.2, 0.75, 0.3, 1) var(--delay) forwards;
}

@keyframes pink-confetti-fall {
    0% {
        opacity: 1;
        transform: translate3d(0, -10vh, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--drift), 115vh, 0) rotate(var(--rotation));
    }
}

.falling-flowers {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow: hidden;
    pointer-events: none;
}

.falling-flower {
    position: absolute;
    top: -2rem;
    left: var(--left);
    display: block;
    font-size: var(--size);
    line-height: 1;
    opacity: 0.9;
    filter: drop-shadow(0 2px 3px rgba(100, 20, 35, 0.18));
    animation: flower-fall var(--duration) linear var(--delay) infinite;
}

.flower-red {
    filter: hue-rotate(-12deg) saturate(1.45) drop-shadow(0 2px 3px rgba(100, 20, 35, 0.18));
}

.flower-pink {
    filter: hue-rotate(315deg) saturate(1.1) drop-shadow(0 2px 3px rgba(100, 20, 35, 0.18));
}

@keyframes flower-fall {
    0% {
        transform: translate3d(0, -8vh, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(var(--drift), 50vh, 0) rotate(calc(var(--rotation) / 2));
    }
    100% {
        transform: translate3d(calc(var(--drift) * -0.6), 112vh, 0) rotate(var(--rotation));
    }
}

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

/* Tablets and small laptops */
@media (max-width: 768px) {
    .wedding-video {
        height: 100%;
    }
}

/* Phones */
@media (max-width: 600px) {
    .intro-overlay {
        align-items: stretch;
        justify-content: flex-start;
        padding: 5vh 0 2vh;
    }

    .envelope-button {
        min-height: auto;
        justify-content: flex-start;
        gap: clamp(0.9rem, 3vh, 1.4rem);
    }

    .envelope-image {
        width: min(86vw, 430px);
        max-width: 86vw;
        max-height: none;
        height: auto;
    }

    .tap-text {
        font-size: clamp(0.65rem, 3vw, 0.85rem);
        letter-spacing: clamp(1.5px, 0.7vw, 2px);
    }
    .intro-video {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
    }

    .section-2 h2 {
        font-size: clamp(1.6rem, 9vw, 2.5rem);
    }

    .scratch-row {
        max-width: 24rem;
    }

    .scratch-card {
        aspect-ratio: 0.78;
    }

    .scratch-card-value {
        font-size: clamp(0.9rem, 6vw, 1.3rem);
    }

    .scratch-card-label,
    .scratch-card-subvalue {
        letter-spacing: 0.08em;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .scratch-row {
        gap: 0.35rem;
    }

    .scratch-card-inset-1 {
        inset: 4px;
    }

    .scratch-card-inset-2 {
        inset: 6px;
    }
}

/* Landscape phones (short viewport height) */
@media (max-height: 480px) and (orientation: landscape) {
    .envelope-image {
        max-height: 50dvh;
    }

    .intro-overlay {
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }
} 



html,
body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas {
    max-width: 100%;
}

@media (max-width: 600px) {
    .intro-overlay,
    .intro-video {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
    }

    .intro-video {
        object-fit: cover;
    }

    .section-1,
    .section-3,
    .section-4,
    .section-5 {
        width: 100%;
        overflow: hidden;
    }

    .responsive-image {
        width: 100%;
        height: auto;
    }

    .section-2 {
        width: 100%;
        min-height: auto;
        padding: 2.5rem 0.75rem;
    }

    .section-2 h2 {
        max-width: 95vw;
        font-size: clamp(1.75rem, 9vw, 2.5rem);
    }

    .scratch-row {
        width: 100%;
        max-width: 24rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(0.35rem, 2.5vw, 0.75rem);
    }

    .scratch-card {
        width: 100%;
        min-width: 0;
        aspect-ratio: 0.76;
    }

    .scratch-card-face {
        padding: 0.3rem;
    }

    .scratch-card-value {
        font-size: clamp(0.9rem, 5.5vw, 1.3rem);
    }

    .scratch-status {
        width: 100%;
        height: auto;
        min-height: 3rem;
        padding: 0 0.5rem;
    }
}

.section-4 > a {
    display: block;
}


.map-card {
    position: relative;
    width: 100%;
}

.map-link {
    position: absolute;
    /* Matches the "Open in Maps" button printed in 3.png. */
    top: 68.75%;
    left: 40.5%;
    z-index: 5;
    width: 19.5%;
    height: 4.25%;
    display: block;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 600px) {
    .map-link {
        top: 68.75%;
        left: 40.5%;
        width: 19.5%;
        height: 4.25%;
    }
}


.music-button {
    position: fixed;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1100;
    border: 0;
    border-radius: 999px;
    padding: 0.75rem 1rem;
    color: #fff;
    background: #3D521E;
    font: 600 0.8rem Montserrat, sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
}
