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

.families {
    --lamp-w: min(30cqi, 150px, 13svh);
    --gap: clamp(30px, 9cqi, 90px);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 58px 16px 52px;
    overflow: hidden;
    background: url(../assets/families/wall.webp) center top / var(--wall-w) var(--wall-h) repeat, var(--emerald-deep);
    color: var(--ivory);
    text-align: center;
    container-type: inline-size;
    -webkit-tap-highlight-color: transparent
}

html.is-tablet .families,
html:not(.is-tablet) .card .families {
    --lamp-w: min(22cqi, 190px, 13svh)
}

.families:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 70% at 50% 45%, #03170f73, #03170fdb);
    pointer-events: none
}

.fm-glow {
    position: absolute;
    inset: 0;
    -webkit-mask: url(../assets/families/wall-mirrors.webp) center top / var(--wall-w) var(--wall-h) repeat;
    mask: url(../assets/families/wall-mirrors.webp) center top / var(--wall-w) var(--wall-h) repeat;
    background: radial-gradient(circle calc(var(--lamp-w) * 2.3) at var(--gx, 25%) var(--gy, 40%), rgba(255, 238, 200, .95), rgba(255, 214, 150, .45) 35%, rgba(255, 200, 130, .1) 70%, transparent);
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none
}

.families>:not(.fm-glow, .fm-threads, .fm-bloom) {
    position: relative
}

.fm-head>* {
    margin: 0
}

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

.fm-title {
    font: 400 clamp(40px, 11cqi, 64px)/1.15 "Alex Brush", cursive;
    padding: 0 .3em .06em;
    background: url(../assets/hero/gold.webp) 0 0 / 4em 4em;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 .03em .03em rgba(0, 0, 0, .6))
}

.fm-lamps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "a b" "u u";
    column-gap: var(--gap);
    width: 100%;
    max-width: 760px;
    margin-top: 16px
}

.fm-side-a {
    grid-area: a
}

.fm-side-b {
    grid-area: b
}

.fm-union {
    grid-area: u
}

.fm-rail {
    position: absolute;
    top: 0;
    left: calc((100% - var(--gap)) / 4 - 34px);
    right: calc((100% - var(--gap)) / 4 - 34px);
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f3dc9c, #b88d3f 55%, #6f5020);
    box-shadow: 0 2px 4px #00000080
}

.fm-rail:before,
.fm-rail:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    translate: 0 -50%;
    background: radial-gradient(circle at 35% 30%, #fff1c4, #c9a45c 45%, #6f5020);
    box-shadow: 0 1px 3px #00000080
}

.fm-rail:before {
    left: -6px
}

.fm-rail:after {
    right: -6px
}

.fm-side {
    display: flex;
    flex-direction: column;
    align-items: center
}

.fm-hang {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: 50% 0;
    animation: fm-sway 5.4s ease-in-out infinite alternate
}

.fm-side-b .fm-hang {
    animation-duration: 6.1s;
    animation-delay: -2.2s
}

@keyframes fm-sway {
    0% {
        rotate: -1.3deg
    }
    to {
        rotate: 1.3deg
    }
}

.fm-chain {
    display: block;
    width: calc(var(--lamp-w) * .07);
    min-width: 6px;
    height: clamp(26px, 8cqi, 64px);
    background: url(../assets/families/chain.webp) center top / 100% auto repeat-y;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
    margin-bottom: -2px
}

.fm-lamp {
    position: relative;
    display: block;
    width: var(--lamp-w);
    aspect-ratio: var(--lantern-r);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 40px;
    -webkit-tap-highlight-color: transparent
}

.fm-lamp:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 6px
}

.is-lit .fm-lamp {
    cursor: default
}

.fm-lantern {
    position: absolute;
    inset: 0;
    background: center / 100% 100% no-repeat;
    pointer-events: none
}

.fm-unlit {
    background-image: url(../assets/families/lantern-unlit.webp);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55))
}

.fm-lit {
    background-image: url(../assets/families/lantern-lit.webp);
    opacity: 0
}

.fm-flicker {
    background: none;
    -webkit-mask: url(../assets/families/lantern-glow.webp) center / 100% 100% no-repeat;
    mask: url(../assets/families/lantern-glow.webp) center / 100% 100% no-repeat;
    background-color: #ffc46e8c;
    mix-blend-mode: screen;
    opacity: 0
}

.is-lit .fm-flicker {
    animation: fm-flicker 2.3s steps(1, end) infinite
}

@keyframes fm-flicker {
    0% {
        opacity: .35
    }
    9% {
        opacity: .5
    }
    17% {
        opacity: .28
    }
    26% {
        opacity: .45
    }
    38% {
        opacity: .32
    }
    47% {
        opacity: .55
    }
    58% {
        opacity: .3
    }
    66% {
        opacity: .42
    }
    78% {
        opacity: .26
    }
    87% {
        opacity: .5
    }
    94% {
        opacity: .36
    }
    to {
        opacity: .35
    }
}

.fm-halo {
    position: absolute;
    left: 50%;
    top: 48%;
    width: calc(var(--lamp-w) * 2.6);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 206, 130, .42), rgba(255, 180, 90, .14) 50%, transparent);
    opacity: 0;
    pointer-events: none
}

.is-lit .fm-lit,
.is-lit .fm-halo,
.families.lit-a .fm-glow-a,
.families.lit-b .fm-glow-b {
    opacity: 1
}

.fm-side,
.fm-rail,
.fm-head {
    transition: opacity 1s ease, translate 1.4s cubic-bezier(.2, .7, .2, 1)
}

.fm-side-b {
    transition-delay: .12s
}

.families:not(.is-seen) .fm-side {
    opacity: 0;
    translate: 0 -28px
}

.families:not(.is-seen) .fm-rail,
.families:not(.is-seen) .fm-head {
    opacity: 0
}

.fm-names {
    margin-top: 14px;
    max-width: 100%;
    transition: opacity .9s ease .25s, color .9s ease .25s, text-shadow .9s ease .25s;
    opacity: .28
}

.fm-names>* {
    margin: 0
}

.fm-label {
    font: 600 clamp(10px, 2.7cqi, 13px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px !important
}

.fm-parents {
    font: 500 clamp(17px, 5cqi, 24px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--ivory);
    text-wrap: balance
}

.is-lit .fm-names {
    opacity: 1
}

.is-lit .fm-parents {
    color: var(--gold-soft);
    text-shadow: 0 0 14px rgba(255, 200, 120, .45), 0 1px 2px rgba(0, 0, 0, .6)
}

.fm-union {
    margin-top: clamp(26px, 8cqi, 48px);
    opacity: 0;
    translate: 0 10px;
    transition: opacity 1.1s ease, translate 1.2s cubic-bezier(.2, .7, .2, 1)
}

.fm-union>* {
    margin: 0
}

.families.is-united .fm-union {
    opacity: 1;
    translate: none
}

.fm-couple {
    font: 400 clamp(40px, 12cqi, 66px)/1.1 "Alex Brush", cursive;
    padding: 0 .3em .08em;
    background: radial-gradient(circle at 50% 45%, rgba(255, 250, 230, .55), transparent 55%), url(../assets/hero/gold.webp) 0 0 / 4em 4em;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 .2em rgba(255, 200, 120, .35)) drop-shadow(0 .03em .03em rgba(0, 0, 0, .6))
}

.fm-couple i {
    font-style: normal;
    font-size: .62em
}

.fm-dua {
    margin-top: 12px !important;
    font: 400 clamp(20px, 6.2cqi, 30px)/1.9 "Amiri", serif;
    color: var(--gold-soft)
}

.fm-dua-en {
    font: italic 500 clamp(15px, 4.4cqi, 20px)/1.4 "Cormorant Garamond", Georgia, serif;
    color: #f5efe2e0;
    max-width: 30em;
    margin-inline: auto !important;
    text-wrap: balance
}

.fm-dua-ref {
    margin-top: 6px !important;
    font: 600 clamp(10px, 2.6cqi, 12px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold)
}

.fm-hint {
    margin: 20px 0 0;
    font: italic 500 clamp(15px, 4.4cqi, 19px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--gold-soft);
    animation: fm-hint 2.8s ease-in-out infinite;
    transition: opacity .6s
}

.families.is-joined .fm-hint {
    opacity: 0 !important;
    animation: none
}

.fm-hint {
    visibility: hidden;
    animation: none
}

@keyframes fm-hint {
    0%,
    to {
        opacity: .5
    }
    50% {
        opacity: 1
    }
}

.fm-threads {
    position: absolute;
    left: 0;
    top: 0;
    overflow: visible;
    pointer-events: none
}

.fm-threads path {
    fill: none;
    stroke-linecap: round;
    opacity: 0
}

.fm-thread-glow {
    stroke: #ffce82b3;
    stroke-width: 7;
    filter: url(#fmBlur)
}

.fm-thread-core {
    stroke: #fff4d6;
    stroke-width: 1.6
}

.fm-bloom {
    position: absolute;
    left: 0;
    top: 0;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 252, 236, .95), rgba(255, 222, 160, .45) 35%, rgba(255, 200, 120, .12) 65%, transparent);
    opacity: 0;
    pointer-events: none
}

@media(min-aspect-ratio:6/5) {
    html.is-tablet .families {
        --lamp-w: min(12cqi, 160px, 15svh);
        --gap: clamp(20px, 3cqi, 44px)
    }
    html.is-tablet .fm-lamps {
        grid-template-columns: 1fr minmax(0, 1.5fr) 1fr;
        grid-template-areas: "a u b";
        max-width: 1080px;
        align-items: start
    }
    html.is-tablet .fm-union {
        margin-top: 0;
        align-self: center
    }
    html.is-tablet .fm-rail {
        left: calc((100% - 2 * var(--gap)) / 7 - 30px);
        right: calc((100% - 2 * var(--gap)) / 7 - 30px)
    }
}

@media(prefers-reduced-motion:reduce) {
    .fm-side,
    .fm-rail,
    .fm-head {
        transition: none
    }
    .fm-hang,
    .fm-hint,
    .is-lit .fm-flicker {
        animation: none
    }
    .is-lit .fm-flicker {
        opacity: .35
    }
}