/* Welcome page (index.html, the first page guests see): the couple's photo, the Save the Date card and the wax seal that opens the invitation.
 * The card is one image exported from Canva, scaled as a whole, so it looks identical on every phone, tablet and computer. */
.wl-body {
    background: #cfcbc4;
    overflow: hidden;
}

.wl {
    --wl-paper: #ece4d6;                                              /* the beige card */
    --wl-shadow: rgb(0 0 0 / .5);
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: grid;
    place-items: center;
    /* 50% 8%: on wide screens the photo is cropped top/bottom; keep the couple's heads in view. */
    background: #cfcbc4 url('../images/welcome-photo.webp') 50% 8% / cover no-repeat;
}

/* Card + seals. Width: as wide as the screen allows, but short enough to fit the height (card ratio 0.71). */
.wl-stage {
    position: relative;
    width: min(82vw, 440px, calc(66vh * 0.71));
    width: min(82vw, 440px, calc(66dvh * 0.71));
    translate: 0 -3%;
    transition: opacity .6s ease .15s, transform .7s cubic-bezier(.4, 0, .2, 1) .15s;
}

/* The card is the image exported from Canva (images/card.webp, 807 × 1142), so its fonts match exactly. */
.wl-card {
    position: relative;
    z-index: 2;
    aspect-ratio: 807 / 1142;
    background: var(--wl-paper);   /* shows for a moment while the image loads */
    box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 28px 60px -22px var(--wl-shadow);
}

.wl-card__art {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* Read by screen readers and link previews; the card image shows the same words. */
.wl-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wl-seal-top {
    position: absolute;
    top: 0;
    left: 50%;
    width: 19%;
    translate: -50% -48%;
    filter: drop-shadow(0 3px 4px rgb(0 0 0 / .3));
    pointer-events: none;
    user-select: none;
}

/* The bottom seal: the button that opens the invitation. */
.wl-seal {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 100%;
    width: 34%;
    translate: -50% -26%;   /* sits just below "You are invited… our special day", as in the Canva design */
    display: block;
    border-radius: 50%;
    transition: transform .25s ease;
    -webkit-tap-highlight-color: transparent;
}

.wl-seal img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 8px rgb(0 0 0 / .35));
    user-select: none;
    -webkit-user-drag: none;
}

.wl-seal:hover,
.wl-seal:focus-visible { transform: scale(1.05); }
.wl-seal:focus-visible { outline: 2px solid var(--wl-paper); outline-offset: 6px; }

/* A soft ring that keeps widening from the seal: "tap me". */
.wl-seal::before {
    content: "";
    position: absolute;
    inset: -4%;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--wl-paper) 85%, transparent);
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .wl-seal::before { animation: wl-ring 2.8s ease-out infinite; }
    .wl-seal img { animation: wl-breathe 2.8s ease-in-out infinite; }
}

@keyframes wl-ring {
    0% { transform: scale(.92); opacity: 0; }
    20% { opacity: .9; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes wl-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

/* Opening: the seal is pressed, the card lifts away and the page fades into the invitation's background. */
.wl::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: var(--sb-bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s ease .25s;
}

.wl.is-opening::after { opacity: 1; }
.wl.is-opening .wl-seal { transform: scale(.9); }
.wl.is-opening .wl-stage { opacity: 0; transform: translateY(-4%) scale(.97); }
