/*! © 2026 Dastan Invites, dastaninvites.com. All rights reserved. This invitation's design, code, artwork and music may not be copied, reused or resold. */

.letter {
    --lw: min(100cqi - 24px, 560px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--seam-h) * .5 + 40px) 12px calc(var(--seam-h) * .5 + 48px);
    overflow-x: clip;
    overflow-anchor: none;
    -webkit-tap-highlight-color: transparent
}

.lt-head {
    position: relative;
    text-align: center;
    margin: 0 calc(var(--band-w) - 16px) 6px
}

.lt-head>* {
    margin: 0
}

.lt-kicker {
    font: 700 clamp(11px, 3cqi, 14px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .28em;
    padding-left: .28em;
    text-transform: uppercase;
    color: var(--madder)
}

.lt-for {
    font: 400 clamp(56px, 17cqi, 100px)/1.1 "Italianno", cursive;
    overflow-wrap: break-word
}

.lt-for .walnut {
    display: inline-block;
    padding: 0 .3em .06em
}

.lt-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto
}

.letter.is-open {
    justify-content: flex-start
}

.lt-slot {
    width: 100%;
    display: none;
    justify-content: center
}

.letter.is-open .lt-slot {
    display: flex
}

.lt-letter {
    position: relative;
    width: var(--lw);
    margin: 0;
    border-style: solid;
    border-color: transparent;
    border-width: var(--deckle);
    padding: calc(var(--spray-t) * .8) calc(var(--lw) * .07) calc(var(--lw) * .05);
    filter: drop-shadow(0 1px 1px rgba(70, 40, 15, .18)) drop-shadow(0 12px 16px rgba(60, 35, 12, .22));
    text-align: center;
    container-type: inline-size;
    font: 500 clamp(15px, 4.4cqi, 19px)/1.55 "Cormorant Garamond", Georgia, serif;
    color: var(--ink)
}

.letter:not(.is-read) .lt-slot .lt-letter {
    visibility: hidden
}

.lt-letter>* {
    margin: 0 0 .8em
}

.lt-verse {
    font: 400 clamp(18px, 6.6cqi, 27px)/2.05 "Amiri Quran", "Amiri", serif;
    color: var(--walnut);
    margin-bottom: .3em !important
}

.lt-verse-en {
    font-style: italic;
    font-size: .9em;
    line-height: 1.45;
    color: #3a2415d6;
    margin-bottom: .3em !important
}

.lt-verse-ref {
    font: 700 clamp(10px, 3cqi, 13px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--madder)
}

.lt-rule {
    position: relative;
    height: 16px;
    margin: 1em auto 1.1em !important;
    width: 62%;
    background: repeating-linear-gradient(90deg, var(--madder) 0 5px, transparent 5px 8px) center / 100% 1.5px no-repeat;
    -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
    mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent)
}

.lt-rule i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    translate: -50% -50%;
    rotate: 45deg;
    background: radial-gradient(circle, var(--saffron) 0 1.8px, transparent 2.2px), linear-gradient(var(--wool), var(--wool)) center / 5px 5px no-repeat, linear-gradient(135deg, #b8352d, var(--madder) 60%, #7a1f1a);
    box-shadow: 0 0 0 2px #f6efe1, 0 0 0 3.2px var(--moss)
}

.lt-greeting {
    font: 400 clamp(36px, 12.4cqi, 54px)/1.15 "Italianno", cursive;
    text-wrap: balance;
    margin-bottom: .25em !important
}

.lt-greeting .walnut,
.lt-sign .walnut {
    display: inline-block;
    padding: 0 .22em .06em
}

.lt-invite {
    font-style: italic;
    font-weight: 600;
    font-size: 1.06em;
    line-height: 1.45;
    color: var(--walnut)
}

.lt-urdu {
    font: 400 clamp(14px, 6cqi, 24px)/2.3 "Noto Nastaliq Urdu", serif;
    color: var(--walnut);
    margin: 1em 0 0 !important
}

.lt-urdu-en {
    font-style: italic;
    font-size: .88em;
    color: #3a2415c2
}

.lt-closing {
    font-style: italic;
    margin: 1.3em 0 0 !important
}

.lt-sign {
    font: 400 clamp(46px, 15cqi, 66px)/1.1 "Italianno", cursive;
    margin-bottom: .1em !important
}

.lt-seal,
.pk-seal,
.lt-flyseal {
    aspect-ratio: 1;
    background: url(../assets/letter/seal.webp) center / contain no-repeat;
    container-type: size;
    display: grid;
    place-items: center
}

.lt-seal {
    width: clamp(76px, 24cqi, 116px);
    margin: .2em auto 0 !important;
    filter: drop-shadow(0 3px 4px rgba(60, 20, 10, .35))
}

.lt-mono {
    font: 400 31cqw/1 Italianno, cursive;
    -webkit-text-stroke: .025em currentColor;
    color: #6a1410;
    text-shadow: 0 -.03em .02em rgba(30, 4, 2, .7), 0 .035em .01em rgba(255, 196, 176, .75), 0 .05em .04em rgba(255, 150, 130, .3);
    translate: 0 .04em;
    white-space: nowrap
}

.lt-mono i {
    font-size: .7em;
    font-style: normal;
    margin: 0 .04em
}

.lt-keep {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%
}

.letter.is-open .lt-keep {
    margin-top: clamp(22px, 6cqi, 40px)
}

.lt-box {
    position: relative;
    display: block;
    width: min(84cqi, 520px);
    aspect-ratio: var(--box-r);
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent
}

.letter.is-open .lt-box {
    width: min(60cqi, 300px);
    cursor: default
}

.lt-box:focus-visible {
    outline: 2px solid var(--madder);
    outline-offset: 6px
}

.lt-box:before {
    content: "";
    position: absolute;
    left: 5%;
    right: 0;
    bottom: -4%;
    height: 14%;
    background: radial-gradient(closest-side, rgba(50, 26, 10, .5), transparent);
    filter: blur(4px);
    translate: 3% 0
}

:where(.lt-box)>span {
    position: absolute;
    inset: 0;
    background: center / 100% 100% no-repeat;
    pointer-events: none
}

.b-open {
    z-index: 2;
    background-image: url(../assets/letter/box-open.webp)
}

.b-front {
    z-index: 4;
    background-image: url(../assets/letter/box-open.webp);
    -webkit-mask: url(../assets/letter/box-front.webp) center / 100% 100% no-repeat;
    mask: url(../assets/letter/box-front.webp) center / 100% 100% no-repeat
}

.b-lid {
    z-index: 5;
    background-image: url(../assets/letter/box-lid.webp)
}

.letter.is-open .b-lid {
    visibility: hidden
}

.letter.is-open .b-glint:before {
    animation: none
}

.lt-parents {
    display: none
}

.lt-letter[data-from]>.lt-parents {
    display: block
}

.lt-letter[data-from]>.lt-invite,
.lt-letter[data-from]>p:not([class]),
.lt-letter[data-from]>.lt-closing,
.lt-letter[data-from]>.lt-sign {
    display: none
}

.lt-parents>p {
    margin: 0
}

.lt-parents>p[hidden] {
    display: none
}

.lp-mr {
    margin-top: 1.1em !important;
    font: 700 clamp(10px, 3cqi, 13px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .22em;
    padding-left: .22em;
    text-transform: uppercase;
    color: var(--madder)
}

.lt-parents>.lp-mr:first-child {
    margin-top: .2em !important
}

.lp-name {
    font-weight: 700;
    font-size: 1.18em;
    line-height: 1.25;
    color: var(--walnut);
    text-wrap: balance
}

.lp-line {
    margin-top: .9em !important;
    font-style: italic;
    text-wrap: balance
}

.lp-couple {
    font: 400 clamp(36px, 12.4cqi, 54px)/1.1 "Italianno", cursive
}

.lp-couple .walnut {
    display: inline-block;
    padding: 0 .22em .06em
}

.lp-with {
    font-style: italic;
    color: var(--madder)
}

.lp-couple+.lp-line {
    margin-top: .3em !important
}

.b-glint {
    position: absolute;
    inset: 0;
    overflow: hidden;
    mix-blend-mode: screen
}

.b-glint:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 300%;
    height: 100%;
    background: linear-gradient(104deg, transparent 38%, rgba(255, 246, 222, .5) 47%, rgba(255, 240, 210, .16) 53%, transparent 60%);
    transform: translate(-126.6667%);
    animation: lt-glint 7s ease-in-out 1.2s infinite
}

@keyframes lt-glint {
    0% {
        transform: translate(-126.6667%)
    }
    30%,
    to {
        transform: translate(60%)
    }
}

.lt-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap
}

.lt-packet {
    position: absolute;
    z-index: 3;
    perspective: 1800px;
    transform-style: preserve-3d;
    pointer-events: none;
    transform-origin: 50% 50%
}

.pk-panel {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d
}

.pk-mid {
    top: 0
}

.pk-top {
    bottom: 100%;
    transform-origin: 50% 100%
}

.pk-bottom {
    top: 100%;
    transform-origin: 50% 0
}

.pk-face,
.pk-back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden
}

.pk-face>.lt-letter {
    position: absolute;
    left: 0;
    filter: none
}

.pk-face .lt-seal {
    visibility: hidden
}

.pk-back {
    transform: rotateX(180deg);
    background: linear-gradient(180deg, rgba(120, 80, 40, .1), transparent 18%, transparent 82%, rgba(120, 80, 40, .1)), url(../assets/letter/paper-back.webp) center / cover;
    box-shadow: inset 0 0 0 1px #966e3c42
}

.pk-mid .pk-face {
    box-shadow: 0 10px 24px -10px #3c230c73
}

.pk-seal {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34%;
    max-height: 86%;
    translate: -50% -50%;
    transform: translateZ(4px);
    filter: drop-shadow(0 3px 4px rgba(60, 20, 10, .4))
}

.lt-flyseal {
    position: absolute;
    z-index: 7;
    pointer-events: none;
    filter: drop-shadow(0 5px 8px rgba(60, 20, 10, .35))
}

.lt-petals {
    position: absolute;
    z-index: 6;
    inset: 0;
    overflow: hidden;
    pointer-events: none
}

.lt-petal {
    position: absolute;
    left: 0;
    top: 0;
    background-image: url(../assets/cover/petals.webp);
    background-repeat: no-repeat;
    filter: drop-shadow(1px 2px 1.5px rgba(70, 40, 15, .28));
    will-change: transform, opacity
}

.lt-head,
.lt-keep {
    transition: opacity 1s ease, translate 1.2s cubic-bezier(.2, .7, .2, 1)
}

.lt-keep {
    transition-delay: .15s
}

.letter:not(.is-seen) .lt-head,
.letter:not(.is-seen) .lt-keep {
    opacity: 0;
    translate: 0 16px
}

@media(min-aspect-ratio:6/5) {
    html.is-tablet .letter {
        --lw: min(100cqi - 28px - min(28cqi, 330px) - clamp(24px, 4.5cqi, 60px), 560px)
    }
    html.is-tablet .letter.is-open .lt-stage {
        display: grid;
        grid-template-columns: min(28cqi, 330px) var(--lw);
        justify-content: center;
        align-items: start;
        column-gap: clamp(24px, 4.5cqi, 60px)
    }
    html.is-tablet .letter.is-open .lt-slot {
        grid-column: 2;
        grid-row: 1
    }
    html.is-tablet .letter.is-open .lt-keep {
        grid-column: 1;
        grid-row: 1;
        position: sticky;
        top: calc(50svh - 10cqi);
        margin-top: 12vh
    }
    html.is-tablet .letter.is-open .lt-box {
        width: 100%
    }
}

@media(prefers-reduced-motion:reduce) {
    .b-glint:before {
        animation: none
    }
    .lt-head,
    .lt-keep {
        transition: none
    }
    .lt-petals {
        display: none
    }
}