/*! © 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 - 28px, 560px);
    --stage-w: min(96cqi, 500px);
    --keep-w: min(66cqi, 340px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--seam-h) * .5 + 30px) 14px calc(var(--seam-h) * .5 + 40px);
    overflow-x: clip;
    overflow-anchor: none;
    -webkit-tap-highlight-color: transparent
}

.letter>:is(.lt-head, .lt-stage) {
    position: relative
}

.lt-head {
    text-align: center;
    margin: 0 0 4px;
    z-index: 2
}

.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(--kick)
}

.lt-for {
    font: 400 clamp(48px, 14cqi, 84px)/1.2 "Allura", cursive;
    overflow-wrap: anywhere
}

.lt-for .ink {
    display: inline-block;
    padding: 0 .3em .1em
}

.lt-stage {
    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;
    isolation: isolate;
    width: var(--lw);
    min-height: calc(var(--lw) * var(--pmin));
    margin: 0;
    padding: calc(var(--lw) * var(--pin-t)) calc(var(--lw) * var(--pin-r)) calc(var(--lw) * var(--pin-b)) calc(var(--lw) * var(--pin-l));
    text-align: center;
    container-type: inline-size;
    font: 500 clamp(15px, 4.6cqi, 19px)/1.55 "Cormorant Garamond", Georgia, serif;
    color: var(--ink)
}

.lt-paper {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(20, 50, 72, .16)) drop-shadow(0 12px 16px rgba(14, 40, 60, .2))
}

.lt-paper:before,
.lt-paper:after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    pointer-events: none
}

.lt-paper:before {
    top: calc(var(--lw) * var(--pt));
    bottom: calc(var(--lw) * var(--pb));
    background-position: 0 0;
    background-size: 100% auto;
    background-repeat: repeat-y
}

.lt-paper:after {
    top: 0;
    bottom: 0;
    background-position: 50% 0, 50% 100%;
    background-size: 100% auto, 100% auto;
    background-repeat: no-repeat
}

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

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

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

.lt-verse-en {
    font-style: italic;
    font-size: .9em;
    line-height: 1.45;
    color: #173a52d6;
    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(--kick)
}

.lt-rule {
    position: relative;
    height: 14px;
    margin: 1em auto 1.1em !important;
    width: 62%;
    background: linear-gradient(90deg, transparent, #a9b6bd 18%, #a9b6bd 82%, transparent) center / 100% 1px no-repeat
}

.lt-rule i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 11px;
    height: 11px;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 30%), repeating-conic-gradient(from 10deg, rgba(60, 80, 92, .35) 0 12deg, transparent 12deg 30deg), radial-gradient(circle at 40% 35%, #f4f7f8, #b9c4ca 55%, #7d8b93);
    box-shadow: 0 0 0 2px var(--muslin), 0 1px 2px 2px #28465a40
}

.lt-greeting {
    font: 400 clamp(28px, 10.6cqi, 46px)/1.25 "Allura", cursive;
    text-wrap: balance;
    margin-bottom: .3em !important
}

.lt-greeting .ink,
.lt-sign .ink {
    display: inline-block;
    padding: 0 .2em .08em
}

.lt-invite {
    font-style: italic;
    font-weight: 600;
    font-size: 1.06em;
    line-height: 1.45
}

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

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

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

.lt-sign {
    font: 400 clamp(38px, 12.4cqi, 56px)/1.2 "Allura", cursive;
    margin-bottom: .15em !important
}

.lt-sign .sn {
    white-space: nowrap
}

.lt-sign .sn-amp {
    font-style: normal
}

.lt-sign.is-stacked .sn,
.lt-sign.is-stacked .sn-amp {
    display: block
}

.lt-sign.is-stacked .sn-amp {
    font-size: .62em;
    line-height: 1;
    margin: .02em 0 .04em
}

.lt-seal,
.lt-flyseal {
    aspect-ratio: 1;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    container-type: size;
    display: grid;
    place-items: center
}

.lt-seal {
    width: clamp(80px, 27cqi, 120px);
    margin: .2em auto 0;
    filter: drop-shadow(0 2px 2px rgba(20, 44, 62, .4)) drop-shadow(0 5px 7px rgba(20, 44, 62, .22))
}

.letter:not(.is-sealed) .lt-seal {
    opacity: 0
}

.lt-mono {
    font: 400 calc(var(--seal-blank) * 52cqw)/1 "Allura", cursive;
    color: #5d6c75;
    text-shadow: 0 .03em 0 rgba(255, 255, 255, .85), 0 -.02em .01em rgba(20, 36, 48, .55);
    translate: 0 .04em;
    white-space: nowrap
}

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

.lt-bud {
    position: absolute;
    z-index: 2;
    aspect-ratio: 1;
    pointer-events: none;
    filter: drop-shadow(1px 2px 1.5px rgba(20, 50, 70, .3))
}

.lt-bud i {
    position: absolute;
    inset: 0;
    background-size: 400% 100%;
    background-repeat: no-repeat;
    opacity: 0
}

.lt-bud i:nth-child(1) {
    background-position: 0 0;
    opacity: 1
}

.lt-bud i:nth-child(2) {
    background-position: 33.333% 0
}

.lt-bud i:nth-child(3) {
    background-position: 66.667% 0
}

.lt-bud i:nth-child(4) {
    background-position: 100% 0
}

.lb-1 {
    width: 16%;
    right: -1.5%;
    top: 1%;
    rotate: 12deg
}

.lb-2 {
    width: 15%;
    left: -1%;
    bottom: 4%;
    rotate: -128deg;
    scale: -1 1
}

.lb-3 {
    width: 13%;
    left: 44%;
    top: 40%;
    rotate: -24deg;
    opacity: 0;
    transition: opacity .8s ease
}

.letter.is-read .lb-3 {
    opacity: 1
}

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

.letter.is-open .lt-keep {
    margin-top: clamp(18px, 5cqi, 36px)
}

.lt-parcel {
    position: relative;
    display: block;
    width: var(--stage-w);
    aspect-ratio: var(--stage-r);
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent
}

.letter.is-open .lt-parcel {
    width: var(--keep-w);
    cursor: default
}

.lt-parcel:focus-visible {
    outline: 2px solid var(--kick);
    outline-offset: 4px
}

.pc-stage {
    position: absolute;
    inset: 0;
    perspective: 1400px;
    transform: scale(var(--shut))
}

.letter.is-open .pc-stage {
    transform: none
}

.pc-stage>:where(span:not(.lt-bud)) {
    position: absolute;
    inset: 0;
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden
}

.pc-stage>.pc-plain {
    left: calc(var(--pl-x) * 100%);
    top: calc(var(--pl-y) * 100%);
    width: calc(var(--pl-w) * 100%);
    height: calc(var(--pl-h) * 100%)
}

.pc-stage>.pc-gajra,
.pc-stage>.pc-glint {
    left: calc((var(--pl-x) + var(--pl-w) * var(--gj-x)) * 100%);
    top: calc((var(--pl-y) + var(--pl-h) * var(--gj-y)) * 100%);
    width: calc(var(--pl-w) * var(--gj-w) * 100%);
    height: calc(var(--pl-h) * var(--gj-h) * 100%)
}

.pc-gajra {
    filter: drop-shadow(1px 2px 1.5px rgba(16, 44, 64, .35))
}

.pc-glint {
    overflow: hidden;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%
}

.pc-glint:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 300%;
    background: linear-gradient(115deg, transparent 40%, rgba(236, 246, 255, .7) 49%, rgba(236, 246, 255, .18) 54%, transparent 60%);
    transform: translate(-113.33%);
    will-change: transform;
    animation: lt-glint 8s ease-in-out 2s infinite
}

@keyframes lt-glint {
    0% {
        transform: translate(-113.33%)
    }
    32%,
    to {
        transform: translate(46.67%)
    }
}

.pc-shadow {
    left: calc((var(--env-x) + var(--env-w) * .05) * 100%);
    top: calc((var(--env-y) + var(--env-h) * .08) * 100%);
    width: calc(var(--env-w) * 96%);
    height: calc(var(--env-h) * 96%);
    border-radius: 8%;
    background: #102e4457;
    filter: blur(10px);
    translate: 2.5% 3%
}

.pc-bed,
.of {
    opacity: 0
}

.of-t {
    transform: rotateX(-90deg)
}

.of-b {
    transform: rotateX(90deg)
}

.of-l {
    transform: rotateY(90deg)
}

.of-r {
    transform: rotateY(-90deg)
}

.letter.is-open .pc-bed,
.letter.is-open .of {
    opacity: 1
}

.letter.is-open .of {
    transform: none
}

.letter.is-open :is(.cf, .pc-gajra, .pc-glint, .pc-shadow),
.letter.is-lifted .pc-letter {
    visibility: hidden
}

.lt-loose {
    position: absolute;
    inset: 0;
    pointer-events: none
}

.lt-loose i {
    position: absolute;
    background-image: url(../assets/cover/petals.webp);
    background-repeat: no-repeat;
    filter: drop-shadow(1px 2px 1.5px rgba(20, 50, 70, .28))
}

.lt-loose i:nth-child(1) {
    width: 10.5%;
    left: 4%;
    top: 6%;
    rotate: -32deg
}

.lt-loose i:nth-child(2) {
    width: 8.5%;
    left: 16%;
    top: 3%;
    rotate: 48deg
}

.lt-loose i:nth-child(3) {
    width: 10%;
    right: 4%;
    top: 10%;
    rotate: 76deg
}

.lt-loose i:nth-child(4) {
    width: 8%;
    right: 6%;
    bottom: 13%;
    rotate: 150deg
}

.lt-loose i:nth-child(5) {
    width: 9.5%;
    left: 6%;
    bottom: 7%;
    rotate: -118deg
}

.lt-loose i:nth-child(6) {
    width: 9.5%;
    right: 16%;
    bottom: 2%;
    rotate: 20deg
}

.lt-hint {
    margin: 10px 0 0;
    font: italic 500 clamp(15px, 4.4cqi, 19px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--kick);
    animation: lt-hint 2.8s ease-in-out infinite
}

.letter.is-open .lt-hint {
    display: none
}

.lt-hint {
    display: none !important
}

@keyframes lt-hint {
    0%,
    to {
        opacity: .55
    }
    50% {
        opacity: 1
    }
}

.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
}

.pk-face .lt-paper {
    filter: none
}

.pk-face :is(.lt-seal, .lt-bud) {
    visibility: hidden
}

.pk-back {
    transform: rotateX(180deg);
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 0 1px #788c9640
}

.pk-back.pk-outside {
    background-color: transparent;
    background-position: center;
    background-size: calc(100% * (1 + 2 * var(--fold-pad-x))) calc(100% * (1 + 2 * var(--fold-pad-y)));
    box-shadow: none
}

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

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

.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(30cqi, 340px) - clamp(24px, 4.5cqi, 60px), 580px);
        --stage-w: min(58cqi, 62svh * var(--stage-r), 470px)
    }
    html.is-tablet .letter.is-open .lt-stage {
        display: grid;
        grid-template-columns: min(30cqi, 340px) 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 - 16cqi);
        margin-top: 12vh
    }
    html.is-tablet .letter.is-open .lt-parcel {
        width: 100%
    }
}

@media(prefers-reduced-motion:reduce) {
    .pc-glint:before,
    .lt-hint {
        animation: none
    }
    .lt-head,
    .lt-keep {
        transition: none
    }
    .lt-hint {
        opacity: .9
    }
}