/*! © 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(34cqi, 150px, 17svh);
    --gap: clamp(30px, 10cqi, 96px);
    --wall-w: 470px;
    --fm-ivory: #f4e9d2;
    --fm-brass: #dcb46a;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--seam-h) * .5 + 30px) 16px calc(var(--seam-h) * .5 + 34px);
    overflow: hidden;
    background: url(../assets/families/wall.webp) center top / var(--wall-w) auto repeat, #5a2a1c;
    color: var(--fm-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(24cqi, 190px, 17svh);
    --wall-w: 540px
}

@media(max-aspect-ratio:5/8) {
    html:not(.is-tablet) .card .families {
        --lamp-w: min(34cqi, 150px, 17svh);
        --wall-w: 470px
    }
}

.families:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 95% 70% at 50% 42%, #100c1670, #0a0810cc), linear-gradient(180deg, #1e2c502e, #1e2c500f);
    pointer-events: none
}

.fm-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle calc(var(--lamp-w) * 1.4) at var(--gx, 25%) var(--gy, 40%), rgba(255, 190, 110, .34), rgba(255, 170, 90, .1) 55%, transparent), url(../assets/families/wall.webp) center top / var(--wall-w) auto repeat;
    -webkit-mask: radial-gradient(circle calc(var(--lamp-w) * 1.6) at var(--gx, 25%) var(--gy, 40%), #000, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, .15) 70%, transparent);
    mask: radial-gradient(circle calc(var(--lamp-w) * 1.6) at var(--gx, 25%) var(--gy, 40%), #000, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, .15) 70%, transparent);
    opacity: 0;
    pointer-events: none
}

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

.fm-head>* {
    margin: 0
}

.fm-kicker {
    font: 700 clamp(11px, 3cqi, 14px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .26em;
    padding-left: .26em;
    text-transform: uppercase;
    color: var(--fm-brass);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
}

.fm-title {
    font: 400 clamp(44px, 12cqi, 70px)/1.15 "Great Vibes", cursive
}

.fm-title span,
.fm-couple {
    display: inline-block;
    padding: 0 .28em .08em;
    background: linear-gradient(180deg, #ffffff80, #fff0 38%, #0000 62%, #78461459), linear-gradient(90deg, #f6ecd6, #e9d6b0 30%, #fbf3e2 55%, #e2cda4 82%, #f6ecd6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 .03em .02em rgba(20, 8, 4, .75)) drop-shadow(0 0 .25em rgba(0, 0, 0, .35))
}

.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: 18px
}

.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 - 40px);
    right: calc((100% - var(--gap)) / 4 - 40px);
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f1d79a, #b8883c 55%, #6a4718);
    box-shadow: 0 3px 5px #0000008c;
    z-index: 1
}

.fm-rail:before,
.fm-rail:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    translate: 0 -50%;
    background: radial-gradient(circle at 35% 30%, #fff0c2, #c99e52 45%, #6a4718);
    box-shadow: 0 1px 3px #0000008c
}

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

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

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

.fm-lamp {
    position: relative;
    display: block;
    width: var(--lamp-w);
    aspect-ratio: var(--lamp-r);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 40px;
    transform-origin: calc(var(--chain-x) * 100%) 0;
    animation: fm-sway 5.4s ease-in-out infinite alternate;
    -webkit-tap-highlight-color: transparent
}

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

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

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

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

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

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

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

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

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

.fm-flicker {
    display: none
}

.is-lit .fm-flicker {
    display: block
}

.families.is-asleep .fm-flicker {
    display: none
}

@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: 62%;
    width: calc(var(--lamp-w) * 2.1);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 204, 130, .42), rgba(255, 176, 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: 12px;
    max-width: 100%;
    transition: opacity .9s ease .25s;
    opacity: .34
}

.fm-names>* {
    margin: 0
}

.fm-label {
    font: 700 clamp(10px, 2.7cqi, 13px)/1.3 "Cormorant Garamond", Georgia, serif;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--fm-brass);
    margin-bottom: 6px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6)
}

.fm-parents {
    font: 600 clamp(17px, 5cqi, 24px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--fm-ivory);
    text-wrap: balance;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
    transition: text-shadow .9s ease .25s
}

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

.is-lit .fm-parents {
    text-shadow: 0 0 14px rgba(255, 196, 120, .5), 0 1px 2px rgba(0, 0, 0, .7)
}

.fm-union {
    margin-top: clamp(24px, 7cqi, 44px);
    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 "Great Vibes", cursive;
    filter: drop-shadow(0 0 .22em rgba(255, 196, 120, .4)) drop-shadow(0 .03em .02em rgba(20, 8, 4, .75))
}

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

.fm-dua {
    margin-top: 10px !important;
    font: 400 clamp(20px, 6.2cqi, 30px)/1.9 "Amiri", serif;
    color: #f1d9a4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .7)
}

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

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

.fm-hint {
    margin: 20px 0 0;
    font: italic 500 clamp(15px, 4.4cqi, 19px)/1.3 "Cormorant Garamond", Georgia, serif;
    color: var(--fm-brass);
    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: #ffcc82b3;
    stroke-width: 7;
    filter: url(#fmBlur)
}

.fm-thread-core {
    stroke: #fff3d4;
    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, 250, 232, .95), rgba(255, 220, 156, .45) 35%, rgba(255, 196, 120, .12) 65%, transparent);
    opacity: 0;
    pointer-events: none
}

@media(min-aspect-ratio:6/5) {
    html.is-tablet .families {
        --lamp-w: min(13cqi, 170px, 19svh);
        --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 - 34px);
        right: calc((100% - 2 * var(--gap)) / 7 - 34px)
    }
}

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