:root {
    --ink: #172a3a;
    --muted: #71808b;
    --paper: #fffaf1;
    --coral: #ef765d;
    --sun: #f6c85f;
    --blue: #9fc8c2;
    --shadow: 0 24px 70px rgba(23, 42, 58, .22);
}

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

body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--ink);
    background: #f3e8d8;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .35;
    pointer-events: none;
    background-image: radial-gradient(#b69271 1px, transparent 1px);
    background-size: 24px 24px;
}

.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(2px);
    opacity: .7;
}

.ambient-one {
    width: 34vw;
    height: 34vw;
    top: -14vw;
    left: -10vw;
    background: #f4bf9b;
}

.ambient-two {
    width: 28vw;
    height: 28vw;
    right: -8vw;
    bottom: -10vw;
    background: #b4d2c8;
}

.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .35;
    background: radial-gradient(circle at 12% 24%, var(--coral) 0 2px, transparent 3px), radial-gradient(circle at 87% 30%, var(--sun) 0 2px, transparent 3px), radial-gradient(circle at 80% 80%, var(--blue) 0 2px, transparent 3px);
}

.stage {
    position: relative;
    width: min(100%, 980px);
    min-height: min(720px, 90vh);
    z-index: 1;
}

.intro {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    transition: opacity .7s ease, transform .7s ease;
}

.intro.hidden {
    opacity: 0;
    transform: scale(.9) translateY(20px);
    pointer-events: none;
}

.eyebrow {
    color: var(--coral);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .28em;
}

.intro-title {
    margin-top: 10px;
    font-family: Georgia, serif;
    font-size: clamp(4rem, 11vw, 8.2rem);
    line-height: .9;
    font-weight: 400;
    letter-spacing: -.06em;
}

.intro-title span {
    color: var(--coral);
    font-size: .45em;
    vertical-align: top;
}

.intro-copy {
    max-width: 290px;
    margin: 20px auto 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.gift-button {
    position: relative;
    width: 205px;
    height: 165px;
    margin: 58px auto 0;
    border: 0;
    cursor: pointer;
    background: none;
    transition: transform .35s ease;
}

.gift-button:hover,
.gift-button:focus-visible {
    transform: translateY(-8px) rotate(-2deg);
    outline: none;
}

.gift-glow {
    position: absolute;
    width: 175px;
    height: 50px;
    left: 15px;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(23, 42, 58, .2);
    filter: blur(15px);
}

.gift-box {
    position: absolute;
    width: 168px;
    height: 106px;
    left: 18px;
    bottom: 3px;
    border-radius: 5px 5px 12px 12px;
    background: linear-gradient(135deg, #f18c73, #df5f54);
    box-shadow: inset 0 8px 0 rgba(255, 255, 255, .18), 0 20px 25px rgba(23, 42, 58, .18);
}

.gift-lid {
    position: absolute;
    z-index: 2;
    width: 185px;
    height: 31px;
    left: 10px;
    bottom: 94px;
    border-radius: 6px;
    background: #e86b61;
    box-shadow: inset 0 6px rgba(255, 255, 255, .2);
    transition: transform .8s cubic-bezier(.2, 1.5, .5, 1);
}

.gift-ribbon {
    position: absolute;
    z-index: 3;
    background: var(--sun);
}

.ribbon-vertical {
    width: 27px;
    height: 106px;
    left: 89px;
    bottom: 3px;
    opacity: .95;
}

.ribbon-horizontal {
    width: 185px;
    height: 15px;
    left: 10px;
    bottom: 45px;
    opacity: .9;
}

.gift-lid::after {
    content: "";
    position: absolute;
    width: 27px;
    height: 31px;
    left: 79px;
    background: var(--sun);
}

.gift-bow {
    position: absolute;
    z-index: 4;
    width: 47px;
    height: 31px;
    bottom: 118px;
    background: var(--sun);
    border-radius: 80% 15% 80% 15%;
}

.bow-left {
    left: 63px;
    transform: rotate(25deg);
}

.bow-right {
    right: 48px;
    transform: rotate(65deg);
}

.gift-knot {
    position: absolute;
    z-index: 5;
    width: 21px;
    height: 21px;
    left: 92px;
    bottom: 121px;
    border-radius: 50%;
    background: #e9ab42;
}

.hint {
    margin-top: 18px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
}

.hint-arrow {
    display: inline-block;
    margin-left: 8px;
    color: var(--coral);
    font-size: 20px;
    animation: nudge 1.6s ease-in-out infinite;
}

.birthday {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1fr);
    align-content: center;
    align-items: center;
    gap: clamp(35px, 8vw, 100px);
    padding: 55px clamp(25px, 7vw, 90px);
    border: 1px solid rgba(23, 42, 58, .1);
    border-radius: 4px;
    background: var(--paper);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px) scale(.97);
    pointer-events: none;
    transition: opacity .8s ease, transform .8s ease;
}

.birthday.show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.card-topline {
    position: absolute;
    top: 25px;
    left: 34px;
    right: 34px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .2em;
}

.card-topline .line {
    height: 1px;
    flex: 1;
    background: #d9c9b6;
}

.portrait-frame {
    position: relative;
    width: min(100%, 300px);
    justify-self: center;
    padding: 13px 13px 42px;
    background: #fff;
    box-shadow: 0 15px 30px rgba(23, 42, 58, .16);
    transform: rotate(-3deg);
}

.portrait-frame::before {
    content: "✦";
    position: absolute;
    z-index: 2;
    top: -18px;
    right: -12px;
    color: var(--coral);
    font-size: 35px;
}

.portrait-tape {
    position: absolute;
    z-index: 3;
    width: 72px;
    height: 20px;
    top: -10px;
    left: 35%;
    background: rgba(246, 200, 95, .72);
    transform: rotate(4deg);
}

.photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.08;
    object-fit: cover;
    filter: saturate(.9);
}

.portrait-caption {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    color: var(--muted);
    text-align: center;
    font-family: Georgia, serif;
    font-size: 15px;
    font-style: italic;
}

.message {
    max-width: 420px;
}

.message h2 {
    margin: 13px 0 18px;
    font-family: Georgia, serif;
    font-size: clamp(2.5rem, 5vw, 4.7rem);
    font-weight: 400;
    line-height: .95;
    letter-spacing: -.06em;
}

.message h2 em {
    color: var(--coral);
    font-weight: 400;
}

.note {
    color: #53626c;
    font-size: 15px;
    line-height: 1.75;
}

.wish-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 21px;
}

.wish-list span {
    padding: 7px 11px;
    border: 1px solid #d9c9b6;
    border-radius: 100px;
    color: var(--ink);
    font-size: 11px;
}

.wish-button {
    margin-top: 27px;
    padding: 13px 19px;
    border: 0;
    border-radius: 100px;
    color: #fff;
    background: var(--ink);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.wish-button:hover,
.wish-button:focus-visible {
    background: var(--coral);
    transform: translateY(-3px);
    outline: none;
}

.wish-button span {
    margin-left: 10px;
    color: var(--sun);
}

.signature {
    position: absolute;
    right: 34px;
    bottom: 24px;
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 13px;
    font-style: italic;
}

.signature span {
    color: var(--coral);
}

.footer-note {
    position: fixed;
    z-index: 2;
    bottom: 18px;
    color: #a28e78;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.confetti {
    position: fixed;
    top: -20px;
    z-index: 10;
    width: 8px;
    height: 14px;
    pointer-events: none;
    animation: fall 4s linear forwards;
}

.wish-spark {
    position: fixed;
    z-index: 20;
    color: var(--coral);
    pointer-events: none;
    animation: wish-spark 1.4s ease-out forwards;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes nudge {
    50% {
        transform: translate(4px, -4px);
    }
}

@keyframes wish-spark {
    from {
        transform: scale(.3);
        opacity: 1;
    }

    to {
        transform: translate(var(--x), var(--y)) scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 680px) {
    body {
        padding: 16px;
        overflow: auto;
    }

    .stage {
        min-height: calc(100dvh - 70px);
    }

    .birthday {
        position: relative;
        inset: auto;
        grid-template-columns: 1fr;
        gap: 28px;
        min-height: 0;
        padding: 58px 24px 54px;
    }

    .portrait-frame {
        width: min(100%, 235px);
    }

    .message {
        text-align: center;
    }

    .message .eyebrow {
        font-size: 10px;
    }

    .message h2 {
        font-size: clamp(2.7rem, 13vw, 4.2rem);
    }

    .note {
        font-size: 14px;
    }

    .wish-list {
        justify-content: center;
    }

    .signature {
        right: 0;
        left: 0;
        text-align: center;
    }

    .card-topline {
        left: 22px;
        right: 22px;
    }

    .footer-note {
        position: static;
        margin-top: 8px;
    }

    .birthday.show+.footer-note {
        display: none;
    }
}

@media (max-height: 650px) and (min-width: 681px) {
    .birthday {
        padding-top: 40px;
        padding-bottom: 35px;
        gap: 45px;
    }

    .portrait-frame {
        width: 235px;
    }

    .message h2 {
        font-size: 3.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}