:root {
    color-scheme: dark;
    --night: #080d25;
    --deep-blue: #0e1c46;
    --electric: #193f89;
    --pink: #ff9fca;
    --pink-bright: #ffc0dc;
    --lavender: #d3c4ff;
    --soft-white: #fff7fb;
    --muted: #c1c8e2;
    --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    min-height: 100%;
    background: var(--night);
}

body {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
    color: var(--soft-white);
    background:
        radial-gradient(ellipse at 50% 43%, rgb(34 66 137 / 45%), transparent 48%),
        linear-gradient(145deg, #080d25 5%, #101e4a 54%, #111d43 100%);
    font-family: var(--font-body);
}

body::before,
body::after {
    position: fixed;
    z-index: -1;
    pointer-events: none;
    content: "";
}

body::before {
    inset: 0;
    opacity: 0.3;
    background-image:
        radial-gradient(1px 1px at 12% 23%, #fff 50%, transparent 100%),
        radial-gradient(1px 1px at 80% 16%, #ffd8ec 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 69% 73%, #fff 50%, transparent 100%),
        radial-gradient(1px 1px at 28% 82%, #fff 50%, transparent 100%),
        radial-gradient(1px 1px at 93% 48%, #ffd8ec 50%, transparent 100%);
    background-size: 270px 260px;
}

body::after {
    inset: auto -15% -34% -15%;
    height: 56vh;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgb(41 70 144 / 28%), transparent 68%);
    filter: blur(35px);
}

a {
    color: inherit;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    opacity: 0.19;
    pointer-events: none;
    filter: blur(95px);
}

.ambient-one {
    top: 10%;
    left: -12rem;
    background: #355fe1;
}

.ambient-two {
    right: -14rem;
    bottom: 8%;
    background: #d653a0;
    opacity: 0.11;
}

.floating-hearts {
    position: fixed;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.floating-heart {
    position: absolute;
    bottom: -3rem;
    color: var(--pink);
    opacity: 0;
    text-shadow: 0 0 18px rgb(255 159 202 / 62%);
    animation: float-heart var(--float-duration, 14s) linear var(--float-delay, 0s) infinite;
}

.site-header,
.site-footer {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(1120px, calc(100% - 3rem));
    align-items: center;
    justify-content: space-between;
    margin-inline: auto;
}

.site-header {
    min-height: 82px;
}

.brand,
.home-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.brand {
    color: #e9e9fb;
    font-size: 0.82rem;
    letter-spacing: 0.035em;
}

.brand-heart {
    color: var(--pink);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px rgb(255 159 202 / 65%));
}

.home-link,
.back-link {
    color: #dce1f6;
    font-size: 0.82rem;
    transition: color 180ms ease;
}

.home-link:hover,
.back-link:hover {
    color: var(--pink-bright);
}

main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
}

.page-wrap {
    width: min(100% - 2.5rem, 1020px);
    margin-inline: auto;
}

.home-page {
    padding-block: 4.3rem 3.6rem;
    text-align: center;
}

.hero {
    position: relative;
    max-width: 760px;
    margin: 0 auto 3rem;
    animation: rise-in 850ms both;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #ffd2e6;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.eyebrow > span {
    color: var(--pink);
    font-size: 0.9rem;
}

.hero h1,
.inner-heading h1 {
    margin: 0.8rem 0 1rem;
    color: var(--pink-bright);
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.65rem);
    font-style: italic;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.12;
    text-shadow: 0 3px 34px rgb(241 120 179 / 20%);
}

.hero h1 {
    font-family: "Segoe Script", "Lucida Handwriting", cursive;
    font-style: normal;
    font-weight: 500;
}

.title-heart {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.72em;
    font-style: normal;
    animation: heart-beat 2.2s ease-in-out infinite;
}

.hero-copy,
.inner-heading > p {
    max-width: 550px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.8;
}

.hero-sparkle {
    position: absolute;
    color: #ffe4f1;
    text-shadow: 0 0 16px #ffacd4;
    animation: twinkle 3s ease-in-out infinite;
}

.sparkle-one {
    top: 13%;
    left: 7%;
    font-size: 1.3rem;
}

.sparkle-two {
    top: 58%;
    right: 3%;
    color: #c8d8ff;
    font-size: 1rem;
    animation-delay: 800ms;
}

.sparkle-three {
    right: 12%;
    bottom: -3.7rem;
    color: #ffe4f1;
    font-size: 1.5rem;
    animation-delay: 1.3s;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    text-align: left;
}

.gift-card {
    position: relative;
    display: flex;
    min-height: 230px;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    padding: 1.45rem 1.5rem 1.4rem;
    border: 1px solid rgb(222 224 255 / 15%);
    border-radius: 23px;
    background:
        linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 2%) 57%),
        rgb(18 32 73 / 76%);
    box-shadow: 0 18px 45px rgb(2 7 28 / 22%), inset 0 1px 0 rgb(255 255 255 / 7%);
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
    animation: rise-in 750ms both;
}

.gift-card:nth-child(2) {
    animation-delay: 120ms;
}

.gift-card:nth-child(3) {
    animation-delay: 240ms;
}

.gift-card::after {
    position: absolute;
    right: -3.5rem;
    bottom: -5rem;
    width: 11rem;
    height: 11rem;
    border-radius: 50%;
    background: var(--card-glow, rgb(231 111 171 / 16%));
    content: "";
    filter: blur(33px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.gift-card:hover,
.gift-card:focus-visible {
    z-index: 1;
    transform: translateY(-7px);
    border-color: rgb(255 187 220 / 50%);
    box-shadow: 0 25px 55px rgb(1 5 24 / 40%), 0 0 30px rgb(210 118 188 / 13%);
}

.gift-card:focus-visible,
.home-link:focus-visible,
.brand:focus-visible,
.back-link:focus-visible,
.envelope:focus-visible,
.photo-card:focus-visible,
.viewer-close:focus-visible {
    outline: 2px solid #ffc2df;
    outline-offset: 4px;
}

.gift-card-letter {
    --card-glow: rgb(236 105 170 / 22%);
}

.gift-card-song {
    --card-glow: rgb(112 149 255 / 22%);
}

.gift-card-photos {
    --card-glow: rgb(194 142 238 / 19%);
}

.card-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 1.15rem;
    border: 1px solid rgb(255 255 255 / 15%);
    border-radius: 15px;
    background: rgb(255 255 255 / 7%);
    font-size: 1.4rem;
}

.card-kicker {
    margin-bottom: 0.36rem;
    color: #e9a9ce;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gift-card-song .card-kicker {
    color: #b7c8ff;
}

.gift-card-photos .card-kicker {
    color: #d9b8ff;
}

.card-title {
    margin-bottom: 0.38rem;
    color: #fff7fb;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
}

.card-subtitle {
    padding-right: 1rem;
    color: #c1c8e2;
    font-size: 0.77rem;
    line-height: 1.5;
}

.card-arrow {
    position: absolute;
    right: 1.35rem;
    bottom: 1.32rem;
    color: #ffd0e8;
    font-size: 1rem;
    transition: transform 200ms ease;
}

.gift-card:hover .card-arrow {
    transform: translate(3px, -3px);
}

.closing-note {
    margin: 2.2rem 0 0;
    color: #abb5d5;
    font-size: 0.77rem;
    letter-spacing: 0.025em;
}

.closing-note span {
    padding-inline: 0.3rem;
    color: var(--pink);
}

.site-footer {
    min-height: 66px;
    justify-content: center;
    gap: 0.45rem;
    color: #a7b0d0;
    font-size: 0.72rem;
}

.site-footer span {
    color: var(--pink);
}

.inner-wrap {
    padding-block: 1.8rem 3.5rem;
    animation: rise-in 700ms both;
}

.back-link {
    margin-bottom: 2.2rem;
}

.inner-heading {
    margin: 0 auto 2.15rem;
    text-align: center;
}

.inner-heading h1 {
    margin-top: 0.7rem;
    font-size: clamp(2.35rem, 5vw, 3.8rem);
}

.inner-heading > p {
    font-size: 0.9rem;
}

.letter-scene {
    position: relative;
    display: grid;
    width: min(100%, 560px);
    min-height: 340px;
    justify-items: center;
    margin: 2.3rem auto 0;
    perspective: 1100px;
}

.envelope {
    position: absolute;
    z-index: 2;
    top: 42px;
    display: flex;
    width: min(100%, 420px);
    height: 245px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgb(255 210 230 / 38%);
    border-radius: 17px;
    background: linear-gradient(145deg, #f8b4d2, #dc7eae);
    box-shadow: 0 24px 60px rgb(3 5 24 / 40%), 0 0 42px rgb(236 129 184 / 17%);
    color: #5e2950;
    cursor: pointer;
    transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 400ms ease;
}

.envelope::before,
.envelope::after {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    left: 0;
    height: 66%;
    content: "";
}

.envelope::before {
    background: linear-gradient(35deg, #e99bc0 50%, transparent 50.3%), linear-gradient(-35deg, #f2b0d0 50%, transparent 50.3%);
}

.envelope::after {
    z-index: 2;
    background: linear-gradient(145deg, transparent 49.5%, #edacd0 50%), linear-gradient(215deg, transparent 49.5%, #f6c0da 50%);
}

.envelope-flap {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: 100%;
    height: 57%;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background: linear-gradient(160deg, #ffd8e9, #eea8cd);
    transform-origin: top center;
    transition: transform 520ms ease;
}

.envelope-seal,
.envelope-prompt {
    position: relative;
    z-index: 4;
}

.envelope-seal {
    margin-top: 4rem;
    color: #8f315f;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 2px rgb(87 25 58 / 20%));
}

.envelope-prompt {
    margin-top: 0.65rem;
    color: #672e53;
    font-size: 0.77rem;
    font-weight: 600;
}

.letter-paper {
    position: relative;
    z-index: 1;
    width: min(100% - 1rem, 440px);
    min-height: 290px;
    margin-top: 1.2rem;
    padding: 2.25rem 2rem;
    border: 1px solid rgb(248 214 231 / 70%);
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent 2.5rem, rgb(223 149 181 / 16%) 2.55rem, transparent 2.62rem),
        repeating-linear-gradient(transparent 0, transparent 2rem, rgb(166 122 149 / 12%) 2.05rem, transparent 2.1rem),
        #fff8f8;
    box-shadow: 0 25px 60px rgb(0 5 27 / 37%);
    color: #563d52;
    opacity: 0;
    transform: translateY(28px) scale(0.94);
    transition: opacity 500ms ease, transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
    visibility: hidden;
}

.letter-message {
    min-height: 190px;
    margin-top: 0.85rem;
    color: #563d52;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 2;
    white-space: pre-wrap;
}

.letter-top-heart,
.letter-bottom-flower {
    position: absolute;
    color: #d77cab;
}

.letter-top-heart {
    top: 0.9rem;
    right: 1.15rem;
    font-size: 1.35rem;
}

.letter-bottom-flower {
    right: 1.15rem;
    bottom: 0.75rem;
    color: #c57fa1;
    font-size: 1rem;
}

.letter-scene.is-open .envelope {
    opacity: 0;
    transform: translateY(155px) rotateX(28deg) scale(0.88);
    pointer-events: none;
}

.letter-scene.is-open .envelope-flap {
    transform: rotateX(180deg);
}

.letter-scene.is-open .letter-paper {
    z-index: 3;
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    transition-delay: 100ms;
}

.letter-hint,
.gallery-hint {
    margin: 0 auto;
    color: #aeb8d7;
    font-size: 0.77rem;
    text-align: center;
}

.gallery-hint {
    margin-top: 2rem;
}

.gallery-hint code {
    color: #ffd3e8;
    font-family: Consolas, monospace;
    font-size: 0.73rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.15rem;
    align-items: center;
    max-width: 900px;
    margin: 2.5rem auto 0;
}

.photo-card {
    position: relative;
    display: block;
    min-width: 0;
    padding: 0.65rem 0.65rem 0.8rem;
    overflow: visible;
    border: 1px solid rgb(248 224 236 / 82%);
    border-radius: 8px;
    background: #fff8fb;
    box-shadow: 0 12px 30px rgb(1 6 28 / 32%);
    color: #69465b;
    cursor: zoom-in;
    text-align: center;
    transform: rotate(var(--photo-tilt, -2deg));
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.photo-card:nth-child(even) {
    --photo-tilt: 2deg;
}

.photo-card:nth-child(3) {
    --photo-tilt: -1deg;
}

.photo-card:hover,
.photo-card:focus-visible {
    z-index: 2;
    box-shadow: 0 22px 48px rgb(1 6 28 / 48%);
    transform: translateY(-8px) rotate(0) scale(1.035);
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.12;
    border-radius: 4px;
    background: linear-gradient(145deg, #e9c7d7, #9fb6da 52%, #e7bfd9);
    object-fit: cover;
    transition: opacity 220ms ease;
}

.photo-card-one img {
    background: linear-gradient(145deg, #ffd9e8, #8caedb);
}

.photo-card-two img {
    background: linear-gradient(145deg, #f8d7bd, #dd9fb9 53%, #8aa8d8);
}

.photo-card-three img {
    background: linear-gradient(145deg, #d7d0f0, #9db9d5 53%, #f4c7d8);
}

.photo-card.is-placeholder img {
    opacity: 0;
}

.photo-placeholder {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    left: 0.65rem;
    display: none;
    aspect-ratio: 1 / 1.12;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.45rem;
    border-radius: 4px;
    color: #fff8fc;
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-shadow: 0 2px 12px rgb(25 32 77 / 35%);
}

.photo-placeholder > span:first-child {
    font-size: 2.4rem;
}

.photo-card-one .photo-placeholder {
    background: linear-gradient(145deg, #e58fb1, #718ac6);
}

.photo-card-two .photo-placeholder {
    background: linear-gradient(145deg, #d89c80, #b3699b 53%, #627fb6);
}

.photo-card-three .photo-placeholder {
    background: linear-gradient(145deg, #a69bd2, #6e9cb5 53%, #d59ab9);
}

.photo-card.is-placeholder .photo-placeholder {
    display: flex;
}

.photo-caption {
    display: block;
    padding: 0.72rem 0 0;
    font-family: var(--font-display);
    font-size: 0.84rem;
    font-style: italic;
}

.photo-caption span {
    color: #d57da9;
}

.photo-tape {
    position: absolute;
    z-index: 1;
    top: -0.48rem;
    left: 50%;
    width: 4.2rem;
    height: 1.05rem;
    background: rgb(255 215 233 / 75%);
    box-shadow: 0 2px 6px rgb(14 18 42 / 10%);
    transform: translateX(-50%) rotate(-4deg);
}

.photo-card:nth-child(even) .photo-tape {
    transform: translateX(-50%) rotate(5deg);
}

.photo-viewer {
    position: fixed;
    max-width: min(92vw, 900px);
    max-height: 90vh;
    padding: 3rem 0.8rem 0.8rem;
    overflow: visible;
    border: 1px solid rgb(255 220 238 / 35%);
    border-radius: 14px;
    background: #101a3c;
    box-shadow: 0 24px 90px rgb(0 0 0 / 55%);
}

.photo-viewer::backdrop {
    background: rgb(3 6 20 / 82%);
    backdrop-filter: blur(7px);
}

.viewer-image {
    display: block;
    max-width: min(85vw, 820px);
    max-height: 78vh;
    border-radius: 7px;
    object-fit: contain;
}

.viewer-close {
    position: absolute;
    top: 0.5rem;
    right: 0.7rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 10%);
    color: white;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-heart {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(-12deg) scale(0.75);
    }

    12% {
        opacity: 0.48;
    }

    78% {
        opacity: 0.36;
    }

    100% {
        opacity: 0;
        transform: translate3d(2rem, -115vh, 0) rotate(20deg) scale(1.12);
    }
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.56;
        transform: scale(0.85) rotate(-8deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.14) rotate(8deg);
    }
}

@keyframes heart-beat {
    0%,
    100% {
        transform: scale(1);
    }

    8%,
    22% {
        transform: scale(1.12);
    }

    15%,
    30% {
        transform: scale(1);
    }
}

@media (max-width: 760px) {
    .home-page {
        padding-top: 3.6rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        max-width: 520px;
        margin-inline: auto;
    }

    .gift-card {
        min-height: 185px;
        padding: 1.25rem;
    }

    .card-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 0.75rem;
        border-radius: 13px;
    }

    .hero {
        margin-bottom: 2.25rem;
    }

    .sparkle-one {
        left: 0;
    }

    .sparkle-two {
        right: 0;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
        max-width: 570px;
    }

    .photo-card:last-child {
        grid-column: 1 / -1;
        width: calc(50% - 0.625rem);
        justify-self: center;
    }
}

@media (max-width: 440px) {
    .site-header,
    .site-footer {
        width: min(100% - 2rem, 1120px);
    }

    .site-header {
        min-height: 68px;
    }

    .brand {
        font-size: 0.73rem;
    }

    .page-wrap {
        width: min(100% - 1.6rem, 1020px);
    }

    .home-page {
        padding-top: 3rem;
    }

    .hero-copy {
        max-width: 310px;
        font-size: 0.87rem;
    }

    .eyebrow {
        font-size: 0.61rem;
        letter-spacing: 0.14em;
    }

    .closing-note {
        max-width: 290px;
        margin-inline: auto;
        line-height: 1.8;
    }

    .inner-wrap {
        padding-top: 1rem;
    }

    .back-link {
        margin-bottom: 1.7rem;
        font-size: 0.74rem;
    }

    .inner-heading {
        margin-bottom: 1.6rem;
    }

    .inner-heading > p {
        max-width: 300px;
        font-size: 0.84rem;
    }

    .letter-scene {
        min-height: 330px;
    }

    .envelope {
        height: 225px;
    }

    .letter-paper {
        min-height: 270px;
        padding-inline: 1.55rem;
    }

    .photo-grid {
        gap: 0.8rem;
    }

    .photo-card:last-child {
        width: calc(50% - 0.4rem);
    }

    .photo-card {
        padding: 0.48rem 0.48rem 0.62rem;
    }

    .photo-placeholder {
        top: 0.48rem;
        right: 0.48rem;
        left: 0.48rem;
        font-size: 0.68rem;
    }

    .photo-caption {
        font-size: 0.72rem;
    }

    .photo-tape {
        width: 3.4rem;
        height: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
