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

.letter {
    --band-h: 20px;
    --gold-deep: #86662a;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--band-h) + 34px) 16px calc(var(--band-h) + 44px);
    background: url(../assets/letter/marble.webp) center top / 100% auto repeat-y, #f2ede3;
    color: var(--ink);
    container-type: inline-size;
    overflow-anchor: none;
    -webkit-tap-highlight-color: transparent
}

html.is-tablet .letter,
html:not(.is-tablet) .card .letter {
    --band-h: 26px
}

.lt-band {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--band-h);
    background: url(../assets/letter/band.webp) center / auto 100% repeat-x;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
    pointer-events: none
}

.lt-band-top {
    top: calc(var(--band-h) * -.5)
}

.lt-band-bottom {
    bottom: calc(var(--band-h) * -.5)
}

.lt-head {
    text-align: center;
    margin: 0 0 8px
}

.lt-head>* {
    margin: 0
}

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

.lt-for {
    font: 400 clamp(44px, 13cqi, 76px)/1.15 "Alex Brush", cursive;
    padding: 0 .3em .1em;
    background: linear-gradient(180deg, rgba(255, 240, 200, .25), transparent 40%, rgba(70, 42, 8, .42)), url(../assets/hero/gold.webp) 0 0 / 4em 4em;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .8)) drop-shadow(0 1px 1.5px rgba(60, 36, 6, .45));
    overflow-wrap: anywhere
}

.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 {
    --pb: clamp(22px, 6.6cqi, 40px);
    position: relative;
    width: min(100%, 580px);
    margin: 0;
    padding: clamp(18px, 5cqi, 34px) clamp(12px, 4cqi, 30px) clamp(26px, 7cqi, 44px);
    border: var(--pb) solid transparent;
    border-image: url(../assets/letter/paper.webp) 86 fill / var(--pb) round;
    box-shadow: 0 1px 2px #3c280a1f, 0 14px 28px -12px #32230a59;
    text-align: center;
    container-type: inline-size;
    font: 500 clamp(15.5px, 5.4cqi, 20px)/1.55 "Cormorant Garamond", Georgia, serif
}

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

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

.lt-verse {
    font: 400 clamp(19px, 6.6cqi, 28px)/2.05 "Amiri Quran", "Amiri", serif;
    color: var(--emerald);
    margin-bottom: .35em
}

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

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

.lt-rule {
    position: relative;
    height: 14px;
    margin: 1.1em auto 1.2em;
    width: 62%;
    background: linear-gradient(90deg, transparent, #b8944e 18%, #b8944e 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: var(--emerald);
    box-shadow: 0 0 0 2px #f4eee1, 0 0 0 3px #b8944e
}

.lt-greeting {
    font: 400 clamp(30px, 10cqi, 44px)/1.2 "Alex Brush", cursive;
    color: var(--emerald);
    margin-bottom: .35em !important
}

.lt-urdu {
    font: 400 clamp(17px, 5.8cqi, 25px)/2.3 "Noto Nastaliq Urdu", serif;
    color: var(--emerald);
    margin: 1.1em 0 0 !important
}

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

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

.lt-sign {
    font: 400 clamp(34px, 11cqi, 50px)/1.15 "Alex Brush", cursive;
    color: var(--emerald);
    margin-bottom: .2em !important
}

.lt-parents {
    display: none
}

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

.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.2em !important;
    font: 600 clamp(10px, 2.9cqi, 13px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .22em;
    padding-left: .22em;
    text-transform: uppercase;
    color: var(--gold-deep)
}

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

.lp-name {
    font-weight: 600;
    font-size: 1.2em;
    line-height: 1.25;
    color: var(--emerald);
    text-wrap: balance
}

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

.lp-couple {
    font: 400 clamp(30px, 10cqi, 44px)/1.2 "Alex Brush", cursive;
    color: var(--emerald)
}

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

.lp-couple+.lp-line {
    margin-top: .4em !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(64px, 22cqi, 104px);
    margin: .2em auto 0 !important;
    filter: drop-shadow(0 3px 4px rgba(50, 30, 5, .35))
}

.lt-mono {
    font: 700 31cqw/1 Cormorant Garamond, Georgia, serif;
    letter-spacing: .01em;
    color: #47300a;
    text-shadow: 0 .035em 0 rgba(255, 240, 196, .85), 0 -.025em .01em rgba(40, 24, 2, .55);
    translate: 0 -.03em
}

.lt-mono i {
    font-size: .62em;
    font-style: italic;
    margin: 0 .04em;
    vertical-align: .18em
}

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

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

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

.letter:not(.is-open) .lt-casket {
    margin-top: calc(min(84cqi, 520px) / var(--casket-r) * -.19)
}

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

.lt-casket:focus-visible {
    outline: 2px solid var(--gold-deep);
    outline-offset: 6px
}

.lt-casket:before {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 1%;
    height: 7%;
    background: radial-gradient(closest-side, rgba(45, 32, 12, .5), transparent);
    filter: blur(3px)
}

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

.c-lid-open {
    z-index: 1;
    background-image: url(../assets/letter/casket-open.webp);
    clip-path: inset(0 0 calc(100% - var(--hinge)) 0);
    transform-origin: 50% var(--hinge);
    opacity: 0
}

.c-body {
    z-index: 2;
    background-image: url(../assets/letter/casket-open.webp);
    clip-path: inset(var(--hinge) 0 0 0)
}

.c-front {
    z-index: 4;
    background-image: url(../assets/letter/casket-open.webp);
    clip-path: inset(var(--rim) 0 0 0)
}

.c-lid {
    z-index: 5;
    background-image: url(../assets/letter/casket-lid.webp);
    transform-origin: 50% var(--hinge)
}

.c-glint {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask: url(../assets/letter/casket-lid.webp) center / 100% 100% no-repeat;
    mask: url(../assets/letter/casket-lid.webp) center / 100% 100% no-repeat;
    mix-blend-mode: screen
}

.c-glint:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 260%;
    height: 100%;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 250, 232, .75) 50%, transparent 62%);
    transform: translate(98.4615%);
    animation: lt-sheen 5.5s ease-in-out 1.2s infinite
}

@keyframes lt-sheen {
    0% {
        transform: translate(98.4615%)
    }
    38%,
    to {
        transform: translate(-160%)
    }
}

.c-sheen {
    position: absolute;
    inset: var(--mirror);
    background: linear-gradient(110deg, transparent 30%, rgba(255, 252, 240, .85) 48%, rgba(255, 240, 200, .3) 56%, transparent 70%) -170% 0 / 260% 100% no-repeat;
    mix-blend-mode: screen
}

.letter.is-open .c-lid {
    opacity: 0
}

.letter.is-open .c-lid-open {
    opacity: 1
}

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

.lt-hint {
    margin: 14px 0 0;
    font: italic 500 clamp(15px, 4.4cqi, 19px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--gold-deep);
    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;
    box-shadow: 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 #32230a73
}

.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(50, 30, 5, .4))
}

.lt-flyseal {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    filter: drop-shadow(0 5px 8px rgba(50, 30, 5, .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.is-open .lt-stage {
        display: grid;
        grid-template-columns: min(28cqi, 330px) minmax(0, 580px);
        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 - 12cqi);
        margin-top: 12vh
    }
    html.is-tablet .letter.is-open .lt-casket {
        width: 100%
    }
}

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