/*! © 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, 580px);
    --sun-y: max(0px, calc(50svh - 340px));
    --sun-x: -16%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--seam-h) * .5 + 34px) 14px calc(var(--seam-h) * .5 + 44px);
    overflow-x: clip;
    overflow-anchor: none;
    -webkit-tap-highlight-color: transparent
}

.lt-head {
    position: relative;
    text-align: center;
    margin: 0 0 6px
}

.lt-head>* {
    margin: 0
}

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

.lt-for {
    font: 400 clamp(46px, 13.5cqi, 80px)/1.2 "Great Vibes", cursive;
    overflow-wrap: anywhere
}

.lt-for .glaze {
    display: inline-block;
    padding: 0 .28em .08em
}

.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(--pb);
    padding: clamp(10px, 3.4cqi, 26px) clamp(8px, 2.6cqi, 22px) clamp(14px, 4cqi, 30px);
    filter: drop-shadow(0 1px 1px rgba(60, 40, 12, .16)) drop-shadow(0 12px 16px rgba(40, 28, 10, .22));
    text-align: center;
    container-type: inline-size;
    font: 500 clamp(15px, 4.5cqi, 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.8cqi, 27px)/2.05 "Amiri Quran", "Amiri", serif;
    color: var(--cobalt);
    margin-bottom: .3em !important
}

.lt-verse-en {
    font-style: italic;
    font-size: .9em;
    line-height: 1.45;
    color: #1b2a52d6;
    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, var(--brass) 18%, var(--brass) 82%, transparent) center / 100% 1px no-repeat
}

.lt-rule i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    translate: -50% -50%;
    rotate: 45deg;
    background: radial-gradient(circle, var(--saffron) 0 1.6px, transparent 2px), linear-gradient(135deg, #2b4fa3, var(--cobalt) 60%, var(--cobalt-deep));
    box-shadow: 0 0 0 2px #f3ead8, 0 0 0 3px var(--brass)
}

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

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

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

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

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

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

.lt-sign {
    font: 400 clamp(36px, 12cqi, 52px)/1.2 "Great Vibes", cursive;
    margin-bottom: .15em !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(70px, 24cqi, 110px);
    margin: .2em auto 0 !important;
    filter: drop-shadow(0 3px 4px rgba(40, 26, 8, .35))
}

.lt-mono {
    font: 400 19.5cqw/1 Great Vibes, cursive;
    -webkit-text-stroke: .014em currentColor;
    color: var(--cobalt);
    text-shadow: 0 .02em 0 rgba(255, 252, 240, .9), 0 .03em .03em rgba(10, 24, 60, .45);
    translate: 0 .02em;
    white-space: nowrap
}

.lt-mono i {
    font-size: .62em;
    font-style: normal;
    margin: 0 .02em;
    color: #b87f22
}

.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(86cqi, 520px);
    aspect-ratio: var(--box-r);
    margin: 6px 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(58cqi, 300px);
    cursor: default
}

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

.lt-box:before {
    content: "";
    position: absolute;
    left: 6%;
    right: 1%;
    bottom: -3%;
    height: 12%;
    background: radial-gradient(closest-side, rgba(40, 24, 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
}

.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, 250, 232, .7) 47%, rgba(255, 246, 220, .2) 53%, transparent 60%);
    transform: translate(-126.6667%);
    animation: lt-glint 7s ease-in-out 1.5s infinite
}

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

.lt-hint {
    margin: 14px 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
}

@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;
    filter: none
}

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

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

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

.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(40, 26, 8, .4))
}

.lt-flyseal {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    filter: drop-shadow(0 5px 8px rgba(40, 26, 8, .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(28cqi, 330px) - clamp(24px, 4.5cqi, 60px), 580px)
    }
    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,
    .lt-hint {
        animation: none
    }
    .lt-head,
    .lt-keep {
        transition: none
    }
    .lt-hint {
        opacity: .9
    }
}