:root {
    color-scheme: light;
    --forest: #244638;
    --ink: #454b3d;
    --paper: #f7efdf;
    --gold: #a27b3d;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'DM Sans', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    position: relative;
    margin: 0;
    min-width: 280px;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 20%, #2b4534 0%, #172e27 50%, #10231e 100%);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23grain)' opacity='.3' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
}

button, summary, a { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, a:focus-visible {
    outline: 2px solid var(--forest);
    outline-offset: 6px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 19px;
    padding: 42px 18px 29px;
    color: #d9cba8;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
}

.little-star { color: #c9ac6c; font-size: 21px; }
main { position: relative; padding: 0 24px; }

.wedding-card {
    position: relative;
    isolation: isolate;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid #c5b489;
    border-radius: 180px 180px 5px 5px / 65px 65px 5px 5px;
    box-shadow: 0 30px 90px #0005, 0 3px 12px #0003;
    animation: card-arrives 1.2s ease-out both;
}

.wedding-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .2;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%238a714e' opacity='.28' filter='url(%23paper)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
}

.card-frame {
    position: absolute;
    z-index: 2;
    inset: 13px;
    border: 1px solid #a58c4c50;
    border-radius: 170px 170px 1px 1px / 57px 57px 1px 1px;
    pointer-events: none;
}

.illustration { position: relative; margin: 0; }
.illustration img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1.84;
    object-fit: cover;
    object-position: center top;
    mix-blend-mode: multiply;
    mask-image: linear-gradient(#000 80%, transparent 100%);
}

.card-content {
    position: relative;
    margin-top: -9px;
    padding: 0 76px 40px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: #78623b;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 3.5px;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--forest);
    font-family: var(--serif);
    font-size: clamp(58px, 9vw, 86px);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -3px;
}

.ampersand { color: var(--gold); font-size: .7em; font-weight: 400; font-style: italic; }
.dedication-note { margin: 12px 0 0; color: #77715f; font-family: var(--serif); font-size: 21px; font-style: italic; }
.ornament { display: flex; justify-content: center; align-items: center; gap: 13px; margin: 25px 0 22px; color: var(--gold); }
.ornament span { width: 66px; height: 1px; background: linear-gradient(90deg, transparent, #b19b66); }
.ornament span:last-child { transform: rotate(180deg); }
.ornament svg { width: 45px; height: 24px; stroke: currentColor; stroke-width: 1; }

.wish .opening {
    margin: 0 0 24px;
    color: var(--forest);
    font-family: var(--serif);
    font-size: 34px;
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.35px;
}

.wish p { margin: 0 0 18px; font-size: 14px; line-height: 1.9; text-wrap: pretty; }
.wish strong { color: var(--forest); font-weight: 600; }
.wish .sign-off { margin: 27px 0 0; color: var(--forest); font-family: var(--serif); font-size: 27px; font-style: italic; }
.wish .sender { margin: 6px 0 10px; }
.wish .gift-note { margin: 0; color: #726242; font-style: italic; }
.magic-keepsake { margin-top: 24px; }

.wax-seal {
    display: inline-grid;
    place-items: center;
    width: 65px;
    height: 65px;
    padding: 0;
    border: 1px solid #b08c48;
    border-radius: 48% 51% 47% 50%;
    background: radial-gradient(circle at 35% 25%, #dbbe79, #bc934b 67%, #a77c39);
    box-shadow: inset 0 0 0 4px #d7b56d, inset 0 0 0 5px #a9813c70, 0 3px 4px #694b3524;
    color: #725326;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.wax-seal svg { width: 29px; height: 29px; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.wax-seal:hover { transform: translateY(-3px) rotate(-5deg); box-shadow: inset 0 0 0 4px #e2c27d, inset 0 0 0 5px #a9813c70, 0 7px 14px #694b352c; }
.wax-seal:active { transform: scale(.94); }
.seal-caption { margin: 13px 0 5px; font-family: var(--serif); font-size: 18px; font-style: italic; color: #726242; }
.tap-hint { font-size: 9px; letter-spacing: 1.3px; text-transform: uppercase; color: #7e745e; }
.closing-ornament { margin: 24px 0 8px; font-size: 22px; color: var(--gold); }
.forever-note { margin: 0; font-size: 9px; font-weight: 500; letter-spacing: 2px; text-transform: uppercase; color: #756647; }

.page-footer { position: relative; padding: 26px 18px 35px; text-align: center; color: #c0c3aa; font-family: var(--serif); font-size: 15px; font-style: italic; }
.page-footer span { display: inline-block; margin-left: 5px; color: #c5ad76; font-style: normal; }

.fireflies, .wish-sparks { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.wish-sparks { z-index: 5; }
.fireflies i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #efce83; box-shadow: 0 0 10px 3px #e0be5340; animation: float 8s ease-in-out infinite alternate, twinkle 5s ease-in-out infinite; }
.fireflies i:nth-child(1) { left: 8%; top: 15%; animation-delay: -1s; }
.fireflies i:nth-child(2) { left: 20%; top: 40%; animation-delay: -5s; }
.fireflies i:nth-child(3) { left: 87%; top: 22%; animation-delay: -3s; }
.fireflies i:nth-child(4) { left: 92%; top: 65%; animation-delay: -7s; }
.fireflies i:nth-child(5) { left: 11%; top: 75%; animation-delay: -4s; }
.fireflies i:nth-child(6) { left: 78%; top: 82%; animation-delay: -2s; }
.fireflies i:nth-child(7) { left: 30%; top: 5%; animation-delay: -8s; }
.fireflies i:nth-child(8) { left: 74%; top: 8%; animation-delay: -6s; }
.fireflies i:nth-child(9) { left: 5%; top: 48%; animation-delay: -2.5s; }
.fireflies i:nth-child(10) { left: 96%; top: 40%; animation-delay: -6.5s; }
.fireflies i:nth-child(11) { left: 17%; top: 91%; animation-delay: -4.5s; }
.fireflies i:nth-child(12) { left: 85%; top: 96%; animation-delay: -1.5s; }
.art-spark { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffe6a6; box-shadow: 0 0 9px 3px #e9ca71a0; animation: twinkle 4s ease-in-out infinite; }
.art-spark-one { left: 25%; top: 45%; }
.art-spark-two { right: 24%; top: 62%; animation-delay: -2s; }
.art-spark-three { right: 42%; top: 18%; animation-delay: -1s; }
.wish-spark { position: absolute; color: #dfbb68; font-family: Georgia, serif; line-height: 1; text-shadow: 0 0 8px #eac875a0; will-change: transform, opacity; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@keyframes card-arrives { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(15px, -25px, 0); } }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

@media (min-width: 1200px) { .page-heading { padding-top: 50px; } }

@media (max-width: 600px) {
    .page-heading { padding: 25px 18px 22px; gap: 12px; font-size: 8px; letter-spacing: 1.5px; }
    .little-star { font-size: 18px; }
    main { padding: 0 14px; }
    .wedding-card { border-radius: 110px 110px 4px 4px / 40px 40px 4px 4px; }
    .card-frame { inset: 9px; border-radius: 100px 100px 1px 1px / 34px 34px 1px 1px; }
    .illustration img { aspect-ratio: 1.6; }
    .card-content { margin-top: 1px; padding: 0 31px 30px; }
    .eyebrow { margin-bottom: 10px; font-size: 8px; letter-spacing: 2.6px; }
    h1 { font-size: clamp(48px, 12vw, 68px); letter-spacing: -2px; }
    .dedication-note { margin-top: 10px; font-size: 18px; }
    .ornament { margin: 21px 0; }
    .ornament span { width: 45px; }
    .wish .opening { font-size: 29px; margin-bottom: 21px; }
    .wish p { font-size: 13px; line-height: 1.85; margin-bottom: 17px; }
    .wish .sign-off { margin-top: 23px; font-size: 25px; }
    .seal-caption { font-size: 17px; }
    .tap-hint { font-size: 8px; letter-spacing: 1px; }
    .forever-note { font-size: 8px; letter-spacing: 1.3px; }
    .page-footer { font-size: 14px; padding-top: 23px; }
}

@media (max-width: 350px) {
    .page-heading { gap: 8px; letter-spacing: 1px; }
    .card-content { padding-right: 24px; padding-left: 24px; }
    h1 { font-size: 44px; }
    .wish .opening { font-size: 26px; }
    .desktop-break { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .fireflies i, .art-spark { opacity: .5; }
}

@media print {
    body { background: white; }
    body::before, .fireflies, .page-heading, .page-footer, .magic-keepsake, .wish-sparks, .art-spark { display: none !important; }
    main { padding: 0; }
    .wedding-card { max-width: 650px; border-color: #c5b489; box-shadow: none; animation: none; break-inside: avoid; }
    .illustration img { max-height: 270px; }
    .card-content { padding-bottom: 32px; }
    .wish p { font-size: 12px; }
}
