/* ═══════════════════════════════════════════════════════════
   ISLAMIC ARABESQUE — deep emerald · antique gold · ivory
   Girih star tiles, mashrabiya lattice, ogee (mihrab) arches, fanous lanterns
   Fonts: Amiri (Arabic & quote) · Marcellus (display) · Jost (body)
═══════════════════════════════════════════════════════════ */
:root {
    --emerald:      #0f4c3e;
    --emerald-d:    #0a2f27;
    --emerald-dd:   #072520;
    --emerald-l:    #1d6b56;
    --ivory:        #f7efdc;
    --ivory-2:      #fbf6ea;
    --paper:        #fffaf0;
    --gold:         #c9a24a;
    --gold-l:       #ead39a;
    --gold-d:       #8f6c26;
    --gold-ink:     #7a5719;

    --bg:           var(--ivory);
    --surface:      var(--paper);
    --text:         #1f2d27;
    --muted:        #56655d;
    --accent:       var(--gold);
    --accent-light: var(--gold-l);
    --accent-dark:  var(--gold-d);

    --gold-flat:    linear-gradient(135deg, #f1dfa4 0%, #c9a24a 48%, #8f6c26 100%);
    --gold-v:       linear-gradient(180deg, #fbefc6 0%, #e2c47a 42%, #c9a24a 62%, #9c772b 100%);
    --gold-sheen:   linear-gradient(100deg, #8f6c26 0%, #c9a24a 22%, #f6e7b8 42%, #c9a24a 58%, #f1dfa4 74%, #8f6c26 100%);
    --octa:         polygon(50% 0%, 64.6% 14.6%, 85.4% 14.6%, 85.4% 35.4%, 100% 50%, 85.4% 64.6%, 85.4% 85.4%, 64.6% 85.4%, 50% 100%, 35.4% 85.4%, 14.6% 85.4%, 14.6% 64.6%, 0% 50%, 14.6% 35.4%, 14.6% 14.6%, 35.4% 14.6%);
    --pointed:      polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);

    --arabic:       'Amiri', 'Times New Roman', serif;
    --display:      'Marcellus', 'Cormorant Garamond', Georgia, serif;
    --sans:         'Jost', 'Segoe UI', system-ui, sans-serif;

    --frame-w:      min(100vw, 640px);
    --pad-section:  calc(var(--frame-w) * .3 + 14px);
    --pat-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23d9b45e' stroke-width='1' opacity='0.16'%3E%3Cpath d='M32.0 12.8L37.6 18.4L45.6 18.4L45.6 26.4L51.2 32.0L45.6 37.6L45.6 45.6L37.6 45.6L32.0 51.2L26.4 45.6L18.4 45.6L18.4 37.6L12.8 32.0L18.4 26.4L18.4 18.4L26.4 18.4ZM39.3 14.3L42.4 21.6L49.7 24.7L46.7 32.0L49.7 39.3L42.4 42.4L39.3 49.7L32.0 46.7L24.7 49.7L21.6 42.4L14.3 39.3L17.3 32.0L14.3 24.7L21.6 21.6L24.7 14.3L32.0 17.3ZM4.6 -11.0L6.4 -6.4L11.0 -4.6L9.1 0.0L11.0 4.6L6.4 6.4L4.6 11.0L0.0 9.1L-4.6 11.0L-6.4 6.4L-11.0 4.6L-9.1 0.0L-11.0 -4.6L-6.4 -6.4L-4.6 -11.0L-0.0 -9.1ZM68.6 -11.0L70.4 -6.4L75.0 -4.6L73.1 0.0L75.0 4.6L70.4 6.4L68.6 11.0L64.0 9.1L59.4 11.0L57.6 6.4L53.0 4.6L54.9 0.0L53.0 -4.6L57.6 -6.4L59.4 -11.0L64.0 -9.1ZM4.6 53.0L6.4 57.6L11.0 59.4L9.1 64.0L11.0 68.6L6.4 70.4L4.6 75.0L0.0 73.1L-4.6 75.0L-6.4 70.4L-11.0 68.6L-9.1 64.0L-11.0 59.4L-6.4 57.6L-4.6 53.0L-0.0 54.9ZM68.6 53.0L70.4 57.6L75.0 59.4L73.1 64.0L75.0 68.6L70.4 70.4L68.6 75.0L64.0 73.1L59.4 75.0L57.6 70.4L53.0 68.6L54.9 64.0L53.0 59.4L57.6 57.6L59.4 53.0L64.0 54.9ZM32.0 0V12.8M32.0 51.2V64M0 32.0H12.8M51.2 32.0H64'/%3E%3Ccircle cx='32.0' cy='32.0' r='6.1'/%3E%3C/g%3E%3C/svg%3E");
    --pat-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23a9802f' stroke-width='1' opacity='0.16'%3E%3Cpath d='M32.0 12.8L37.6 18.4L45.6 18.4L45.6 26.4L51.2 32.0L45.6 37.6L45.6 45.6L37.6 45.6L32.0 51.2L26.4 45.6L18.4 45.6L18.4 37.6L12.8 32.0L18.4 26.4L18.4 18.4L26.4 18.4ZM39.3 14.3L42.4 21.6L49.7 24.7L46.7 32.0L49.7 39.3L42.4 42.4L39.3 49.7L32.0 46.7L24.7 49.7L21.6 42.4L14.3 39.3L17.3 32.0L14.3 24.7L21.6 21.6L24.7 14.3L32.0 17.3ZM4.6 -11.0L6.4 -6.4L11.0 -4.6L9.1 0.0L11.0 4.6L6.4 6.4L4.6 11.0L0.0 9.1L-4.6 11.0L-6.4 6.4L-11.0 4.6L-9.1 0.0L-11.0 -4.6L-6.4 -6.4L-4.6 -11.0L-0.0 -9.1ZM68.6 -11.0L70.4 -6.4L75.0 -4.6L73.1 0.0L75.0 4.6L70.4 6.4L68.6 11.0L64.0 9.1L59.4 11.0L57.6 6.4L53.0 4.6L54.9 0.0L53.0 -4.6L57.6 -6.4L59.4 -11.0L64.0 -9.1ZM4.6 53.0L6.4 57.6L11.0 59.4L9.1 64.0L11.0 68.6L6.4 70.4L4.6 75.0L0.0 73.1L-4.6 75.0L-6.4 70.4L-11.0 68.6L-9.1 64.0L-11.0 59.4L-6.4 57.6L-4.6 53.0L-0.0 54.9ZM68.6 53.0L70.4 57.6L75.0 59.4L73.1 64.0L75.0 68.6L70.4 70.4L68.6 75.0L64.0 73.1L59.4 75.0L57.6 70.4L53.0 68.6L54.9 64.0L53.0 59.4L57.6 57.6L59.4 53.0L64.0 54.9ZM32.0 0V12.8M32.0 51.2V64M0 32.0H12.8M51.2 32.0H64'/%3E%3Ccircle cx='32.0' cy='32.0' r='6.1'/%3E%3C/g%3E%3C/svg%3E");
    --pat-mash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg fill='none' stroke='%23d9b45e' stroke-width='1.3' opacity='.55'%3E%3Cpath d='M17.0 4.8L20.6 8.3L25.7 8.3L25.7 13.4L29.2 17.0L25.7 20.6L25.7 25.7L20.6 25.7L17.0 29.2L13.4 25.7L8.3 25.7L8.3 20.6L4.8 17.0L8.3 13.4L8.3 8.3L13.4 8.3ZM17.0 0V4.76M17.0 29.240000000000002V34M0 17.0H4.76M29.240000000000002 17.0H34M0 0L8.8 8.8M34 0L25.2 8.8M0 34L8.8 25.2M34 34L25.2 25.2'/%3E%3Ccircle cx='17.0' cy='17.0' r='4.7'/%3E%3C/g%3E%3C/svg%3E");
    --mask-arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140' preserveAspectRatio='none'%3E%3Cpath d='M0 140V50C0 28 30 26 42 13Q48 7 50 0Q52 7 58 13C70 26 100 28 100 50V140Z'/%3E%3C/svg%3E");
    --mask-cap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V30C0 16 30 14 42 7Q48 4 50 0Q52 4 58 7C70 14 100 16 100 30V40Z'/%3E%3C/svg%3E");
    --door-arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 300' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23d9b45e' vector-effect='non-scaling-stroke'%3E%3Cpath vector-effect='non-scaling-stroke' stroke-width='1.6' d='M4 296V70C4 44 34 40 44 22Q49 14 50 4Q51 14 56 22C66 40 96 44 96 70V296Z'/%3E%3Cpath vector-effect='non-scaling-stroke' stroke-width='.8' stroke-opacity='.6' d='M10 290V73C10 50 38 46 47 30Q50 24 50 16Q50 24 53 30C62 46 90 50 90 73V290Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    width: 100%;
}
body.no-scroll { overflow: hidden; height: 100vh; }
img { max-width: 100%; display: block; }
main { overflow: hidden; }
::selection { background: var(--emerald); color: var(--gold-l); }
.ia-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ia-sparkles {
    position: fixed; inset: 0; z-index: 1;
    pointer-events: none; opacity: .8;
}

/* ── Tones: emerald (dark) & ivory (light) sections ── */
.tone-dark {
    --fg: #f5edd9; --fg-muted: #d2c7a8; --title-c: var(--gold-l); --eyebrow-c: var(--gold);
    --line: rgba(201,162,74,.38);
    color: var(--fg);
    background:
        var(--pat-dark) center / 64px,
        radial-gradient(ellipse 85% 60% at 50% 42%, #155b4a 0%, var(--emerald) 48%, var(--emerald-d) 100%);
}
.tone-light {
    --fg: #1f2d27; --fg-muted: #56655d; --title-c: var(--emerald); --eyebrow-c: var(--gold-ink);
    --line: rgba(143,108,38,.32);
    color: var(--fg);
    background:
        var(--pat-light) center / 64px,
        radial-gradient(ellipse 85% 60% at 50% 42%, var(--ivory-2) 0%, var(--ivory) 55%, #f0e3c6 100%);
}

/* ── Section frame + injected bingkai ── */
.section-frame {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex; flex-direction: column; justify-content: center;
    padding: var(--pad-section) 0;
}
.section-frame-top, .section-frame-bottom,
.intro-frame-top, .intro-frame-bottom {
    position: absolute; left: 50%; transform: translateX(-50%);
    width: var(--frame-w); line-height: 0;
    pointer-events: none; user-select: none; z-index: 1;
    display: block;
}
.section-frame-top, .intro-frame-top { top: 0; }
.section-frame-bottom, .intro-frame-bottom { bottom: 0; }
.section-frame-top img, .section-frame-bottom img { width: 100%; height: auto; display: block; }
.intro-frame-top, .intro-frame-bottom { height: auto; max-height: 40vh; object-fit: cover; z-index: 3; }
.intro-frame-top { object-position: top; }
.intro-frame-bottom { object-position: bottom; }
.divider { display: block; width: min(260px, 76%); height: auto; margin: 0 auto; }

/* ── Container & headings ── */
.container {
    width: 100%; max-width: 760px; margin: 0 auto; padding: 0 1.5rem;
    position: relative; z-index: 2;
}
.section-head { text-align: center; margin-bottom: 2.2rem; }
.eyebrow {
    display: block;
    font-family: var(--sans); font-weight: 500;
    font-size: .74rem; letter-spacing: .38em; text-transform: uppercase;
    color: var(--eyebrow-c, var(--gold-ink)); margin-bottom: .55rem;
}
.section-title {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(1.8rem, 7.4vw, 2.6rem);
    line-height: 1.2; letter-spacing: .03em;
    color: var(--title-c, var(--emerald));
    margin-bottom: .9rem;
}

/* ── Arch-capped box (ogee top) ── */
.arch-box {
    --cap: 30px;
    --fill: rgba(7,37,32,.88);
    position: relative; isolation: isolate;
    background: var(--gold-flat);
    -webkit-mask: var(--mask-cap) top / 100% var(--cap) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--cap) - 1px) / 100% 100% no-repeat;
            mask: var(--mask-cap) top / 100% var(--cap) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--cap) - 1px) / 100% 100% no-repeat;
}
.arch-box::before {
    content: ''; position: absolute; inset: 1.5px; z-index: -1;
    background: var(--fill);
    -webkit-mask: var(--mask-cap) top / 100% calc(var(--cap) - 1px) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--cap) - 2px) / 100% 100% no-repeat;
            mask: var(--mask-cap) top / 100% calc(var(--cap) - 1px) no-repeat, linear-gradient(#000 0 0) 0 calc(var(--cap) - 2px) / 100% 100% no-repeat;
}

/* ════════════════════════════
   BUTTONS
════════════════════════════ */
.btn-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    position: relative; overflow: hidden;
    padding: .95rem 2.4rem;
    background: var(--gold-flat);
    color: var(--emerald-dd);
    border: none; cursor: pointer;
    clip-path: var(--pointed);
    font-family: var(--sans); font-weight: 600;
    font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
    transition: transform .3s, filter .3s;
}
.btn-gold::before {
    content: ''; position: absolute; inset: 4px; pointer-events: none;
    clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%);
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(10,47,39,.35);
}
.btn-gold::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent);
    transform: skewX(-20deg);
    animation: btnSheen 4.8s ease-in-out infinite;
}
@keyframes btnSheen { 0%, 62% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(475%) skewX(-20deg); } }
.btn-gold:hover { transform: translateY(-2px); filter: brightness(1.08) drop-shadow(0 6px 14px rgba(201,162,74,.35)); }
.btn-gold:focus-visible { outline: none; filter: brightness(1.12); }
.btn-gold:focus-visible::before { box-shadow: inset 0 0 0 2px var(--emerald-dd); }
.btn-gold:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-gold.is-sent { background: linear-gradient(135deg, #2f8a63, #1d6b56); color: #fff; }
.btn-block { width: 100%; }

/* ════════════════════════════
   INTRO / COVER — mashrabiya doors
════════════════════════════ */
.intro {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden auto;
    color: #f5edd9;
}
.intro-doors { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.door {
    position: absolute; top: 0; bottom: 0; width: 50.4%;
    background:
        var(--pat-mash) 0 0 / 34px,
        linear-gradient(180deg, #13574a 0%, var(--emerald) 45%, var(--emerald-d) 100%);
    will-change: transform;
}
.door-l { left: 0; box-shadow: inset -3px 0 0 #b8923e, inset -5px 0 0 rgba(0,0,0,.35); }
.door-r { right: 0; box-shadow: inset 3px 0 0 #b8923e, inset 5px 0 0 rgba(0,0,0,.35); }
.door-inner {
    position: absolute; top: 18px; bottom: 18px; left: 16px; right: 12px;
    background: var(--door-arch) center / 100% 100% no-repeat;
}
.door-r .door-inner { left: 12px; right: 16px; }
.door-ring {
    position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px;
    border: 2px solid #d9b45e; border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.door-ring::before {
    content: ''; position: absolute; left: 50%; top: -12px; width: 12px; height: 12px; margin-left: -6px;
    background: var(--gold-flat); clip-path: var(--octa);
}
.door-l .door-ring { right: 16px; }
.door-r .door-ring { left: 16px; }
.door-star {
    position: fixed; inset: 0; margin: auto; z-index: 2;
    width: min(62vw, 260px); height: min(62vw, 260px);
    visibility: hidden; opacity: 0;
    filter: drop-shadow(0 0 6px rgba(240,214,140,.75));
}
.door-star .draw {
    fill: none; stroke: #f0d68c; stroke-width: 1.6;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    stroke-linejoin: round;
}
.intro-veil {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse 72% 58% at 50% 52%, rgba(7,37,32,.93) 0%, rgba(7,37,32,.78) 55%, rgba(7,37,32,.35) 100%);
}
.intro-content {
    position: relative; z-index: 4;
    width: 100%; max-width: 420px;
    padding: calc(var(--frame-w) * .27) 22px calc(var(--frame-w) * .24); margin: auto;
}
.intro-content > * { animation: introIn 1.2s cubic-bezier(.16,1,.3,1) both; }
.intro-content > :nth-child(2) { animation-delay: .12s; }
.intro-content > :nth-child(3) { animation-delay: .24s; }
.intro-content > :nth-child(4) { animation-delay: .36s; }
.intro-content > :nth-child(5) { animation-delay: .48s; }
.intro-content > :nth-child(6) { animation-delay: .6s; }
@keyframes introIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.bismillah {
    font-family: var(--arabic); font-weight: 400;
    font-size: clamp(1.3rem, 5.8vw, 1.75rem); line-height: 1.9;
    color: var(--gold-l);
    margin-bottom: .6rem;
    text-shadow: 0 0 18px rgba(234,211,154,.25);
}
.intro-emblem { position: relative; width: 150px; height: 150px; margin: 0 auto 1rem; }
.intro-ornamen {
    position: absolute; inset: 0; width: 100%; height: 100%;
    animation: slowSpin 120s linear infinite;
}
@keyframes slowSpin { to { transform: rotate(360deg); } }
.star-seal {
    position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-flat); clip-path: var(--octa); isolation: isolate;
}
.star-seal::before {
    content: ''; position: absolute; inset: 2px; z-index: -1;
    background: radial-gradient(circle at 50% 40%, #1a6652, var(--emerald-dd));
    clip-path: var(--octa);
}
.star-seal span {
    font-family: var(--display); font-size: 1.15rem; letter-spacing: .04em;
    background: var(--gold-v); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--gold-l);
}
.star-seal.small { position: relative; left: auto; top: auto; margin: 0 auto 1.2rem; width: 70px; height: 70px; }
.star-seal.small span { font-size: 1.3rem; }

.intro-subtitle {
    font-size: .74rem; font-weight: 500; letter-spacing: .42em; text-transform: uppercase;
    color: var(--gold); margin-bottom: .55rem;
}
.intro-names, .footer-names {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1.18;
    margin-bottom: 1.5rem; overflow-wrap: anywhere;
    background: var(--gold-v); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--gold-l);
}
.intro-names .amp, .footer-names .amp {
    display: block; font-family: var(--arabic); font-style: italic;
    font-size: .8em; line-height: 1.2;
}
.guest-card {
    --cap: 30px;
    margin: 0 auto 1.7rem; padding: calc(var(--cap) + .2rem) 1.4rem 1.1rem;
    max-width: 320px;
}
.to-label { font-size: .9rem; color: #d2c7a8; }
.guest-name {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(1.3rem, 5.6vw, 1.65rem); line-height: 1.3;
    margin-top: .3rem; color: var(--gold-l);
    overflow-wrap: anywhere;
}

/* ════════════════════════════
   NAVIGATION
════════════════════════════ */
nav#mainNav {
    position: fixed; left: 0; right: 0; margin: 0 auto;
    width: max-content; max-width: calc(100% - 24px);
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateY(160px); opacity: 0;
    z-index: 1000;
    transition: transform .9s cubic-bezier(.16,1,.3,1), opacity .9s, bottom .4s ease;
}
nav#mainNav.visible { transform: translateY(0); opacity: 1; }
body:has(#qr-fab) nav#mainNav, body.has-qr nav#mainNav { bottom: calc(84px + env(safe-area-inset-bottom)); }
.nav-inner {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 10px;
    background: rgba(10,47,39,.93);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(201,162,74,.55);
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(10,47,39,.55), 0 14px 34px rgba(7,37,32,.45);
}
nav#mainNav a {
    flex: 0 0 auto; width: 44px; height: 44px;
    color: #cdbf98; display: flex; align-items: center; justify-content: center; position: relative;
    text-decoration: none; transition: color .3s;
}
nav#mainNav a svg { width: 21px; height: 21px; flex-shrink: 0; }
nav#mainNav a::after {
    content: ''; position: absolute; left: 50%; bottom: 1px;
    width: 7px; height: 7px; margin-left: -3.5px;
    background: var(--gold); clip-path: var(--octa);
    transform: scale(0); transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
nav#mainNav a.active { color: var(--gold-l); background: radial-gradient(circle, rgba(201,162,74,.2) 0 60%, transparent 62%); }
nav#mainNav a.active::after { transform: scale(1); }
nav#mainNav a:hover { color: var(--gold-l); }
nav#mainNav a:focus-visible { outline: 1px solid var(--gold); outline-offset: -2px; border-radius: 50%; }

/* ════════════════════════════
   MUSIC BUTTON (8-point star)
════════════════════════════ */
.music-toggle-btn {
    position: fixed; top: calc(16px + env(safe-area-inset-top)); right: 16px; z-index: 1001;
    width: 44px; height: 44px;
    border: none; cursor: pointer;
    background: var(--gold-flat); clip-path: var(--octa);
    color: var(--gold-l);
    display: flex; align-items: center; justify-content: center;
    isolation: isolate;
    transition: transform .3s, filter .3s;
}
.music-toggle-btn::before {
    content: ''; position: absolute; inset: 2px; z-index: -1;
    background: var(--emerald-d); clip-path: var(--octa);
}
.music-toggle-btn svg { width: 18px; height: 18px; }
.music-toggle-btn:hover { transform: rotate(22.5deg); }
.music-toggle-btn:focus-visible { outline: none; filter: brightness(1.25); }

/* ════════════════════════════
   HERO — mihrab arch + hanging fanous
════════════════════════════ */
.hero.section-frame {
    padding: calc(var(--frame-w) * .16) 16px calc(var(--frame-w) * .27);
    align-items: center;
}
.hero-frame {
    position: relative; z-index: 2;
    width: min(100%, 380px);
    min-height: min(600px, calc(100svh - var(--frame-w) * .43));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 160px 1.6rem 2.4rem;
}
.mihrab { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mihrab-fill { fill: rgba(7,37,32,.62); }
.mihrab-line {
    fill: none; stroke: #d9b45e; stroke-width: 1.8;
    stroke-dasharray: 1; stroke-dashoffset: 0;
}
.mihrab-line.thin { stroke-width: .9; stroke-opacity: .7; }

.hero-lamp { position: absolute; top: 4px; left: 50%; width: 42px; margin-left: -21px; z-index: 1; }
.lamp-swing { transform-origin: 50% 0; animation: lampSway 5.6s ease-in-out infinite; }
.lamp-chain {
    display: block; width: 2px; height: 26px; margin: 0 auto;
    background: repeating-linear-gradient(180deg, #d9b45e 0 4px, transparent 4px 6px);
}
.lamp-body { position: relative; display: block; width: 42px; height: 113px; }
.lamp-body svg { position: relative; width: 100%; height: 100%; display: block; }
.lamp-glow {
    position: absolute; left: 50%; top: 52%;
    width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,222,150,.55) 0%, rgba(243,194,94,.2) 40%, rgba(243,194,94,0) 70%);
    animation: flicker 3.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes lampSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes flicker {
    0%, 100% { opacity: .9; } 18% { opacity: .62; } 22% { opacity: .95; }
    46% { opacity: .72; } 61% { opacity: 1; } 79% { opacity: .7; }
}

.hero-content { position: relative; width: 100%; }
.hero .bismillah { font-size: clamp(1.25rem, 5.4vw, 1.6rem); margin-bottom: .3rem; }
.hero-label {
    font-size: .74rem; font-weight: 500; letter-spacing: .42em; text-transform: uppercase;
    color: var(--gold); margin-bottom: .6rem;
}
.hero-names-wrap { position: relative; isolation: isolate; padding: .6rem 0 1rem; }
.orn-spin {
    position: absolute; left: 50%; top: 50%; z-index: -1;
    width: 250px; height: 250px; margin: -125px 0 0 -125px;
    opacity: .2; animation: slowSpin 140s linear infinite;
}
.hero-ornamen { width: 100%; height: 100%; }
.hero-names {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(2.2rem, 10vw, 3rem); line-height: 1.12;
    display: flex; flex-direction: column; align-items: center;
    perspective: 600px; overflow-wrap: anywhere;
}
.hero-names .hn { display: block; }
.hero-names .w { display: inline-block; white-space: nowrap; }
.hero-names .ch, .hero-names .hn {
    background: var(--gold-v); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--gold-l);
}
.hero-names .ch { display: inline-block; transform-origin: 50% 100%; }
.hero-names .amp {
    display: block; font-family: var(--arabic); font-style: italic;
    font-size: .72em; line-height: 1.25; color: var(--gold);
}
.hero .divider { margin-bottom: 1.2rem; }
.hero-date { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.hero-date .day {
    font-family: var(--display); font-size: clamp(2.6rem, 11vw, 3.3rem); line-height: 1;
    background: var(--gold-v); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--gold-l);
}
.month-year { text-align: left; border-left: 1px solid var(--line); padding-left: 1rem; line-height: 1.4; }
.month-year .month { display: block; font-weight: 500; font-size: 1.05rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-l); }
.month-year .year { font-size: .95rem; color: var(--fg-muted); letter-spacing: .3em; }

/* ════════════════════════════
   QUOTE
════════════════════════════ */
.quote > .container { text-align: center; max-width: 600px; }
.quote-star { width: 62px; height: 62px; margin: 0 auto 1rem; display: block; }
.quote-star .draw { fill: none; stroke: var(--gold-d); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linejoin: round; }
.quote-ar {
    font-family: var(--arabic); font-size: clamp(1.45rem, 6.2vw, 1.9rem); line-height: 2.05;
    color: var(--emerald); margin-bottom: 1rem;
}
.quote-id {
    font-family: var(--arabic); font-style: italic;
    font-size: clamp(1.1rem, 4.4vw, 1.3rem); line-height: 1.7;
    color: var(--fg); margin: 0 auto 1.2rem;
}
.quote cite {
    display: block; font-style: normal; font-weight: 500;
    font-size: .8rem; letter-spacing: .34em; text-transform: uppercase;
    color: var(--gold-ink); margin-bottom: 1.3rem;
}

/* ════════════════════════════
   COUPLE — ogee portraits
════════════════════════════ */
.couple-flex {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: start; gap: 1rem;
    max-width: 620px; margin: 0 auto;
}
.couple-item { text-align: center; min-width: 0; }
.portrait { position: relative; width: 132px; aspect-ratio: 100 / 140; margin: 0 auto 1.3rem; }
.portrait-arch {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22%;
    background:
        var(--pat-dark) center / 32px,
        radial-gradient(ellipse at 50% 30%, #1f7560 0%, var(--emerald) 55%, var(--emerald-d) 100%);
    -webkit-mask: var(--mask-arch) center / 100% 100% no-repeat;
            mask: var(--mask-arch) center / 100% 100% no-repeat;
}
.portrait-arch span {
    font-family: var(--display); font-size: 3rem; line-height: 1;
    background: var(--gold-v); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--gold-l);
}
.portrait-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.portrait-line .draw { fill: none; stroke: var(--gold-d); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 0; }
.name {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(1.25rem, 5.4vw, 1.75rem); line-height: 1.25;
    color: var(--emerald); margin-bottom: .7rem; overflow-wrap: anywhere;
}
.ampersand {
    font-family: var(--arabic); font-style: italic;
    font-size: clamp(2.6rem, 9vw, 3.4rem); color: var(--gold-d);
    align-self: center; line-height: 1; padding-bottom: 3.5rem;
}
.parent { font-size: .95rem; color: var(--fg-muted); line-height: 1.6; }

/* ════════════════════════════
   EVENT — star countdown + arch cards
════════════════════════════ */
.countdown-star {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem;
    max-width: 380px; margin: 0 auto 2.6rem;
}
.time-box { text-align: center; min-width: 0; }
.time-star {
    position: relative; isolation: isolate;
    width: 100%; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-flat); clip-path: var(--octa);
    perspective: 300px;
}
.time-star::before {
    content: ''; position: absolute; inset: 2px; z-index: -1;
    background: radial-gradient(circle at 50% 35%, #1c6a56, var(--emerald-dd));
    clip-path: var(--octa);
}
.time-star span {
    display: block;
    font-family: var(--display); font-size: clamp(1.3rem, 5.8vw, 1.8rem); line-height: 1;
    color: var(--gold-l);
}
.time-box label {
    display: block; margin-top: .5rem;
    font-size: .68rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
    color: var(--fg-muted);
}
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.6rem;
}
.event-card {
    --cap: 54px;
    --fill: linear-gradient(180deg, var(--paper), var(--ivory));
    text-align: center;
    padding: calc(var(--cap) - 10px) 1.5rem 2.1rem;
}
.event-icon { width: 26px; height: 26px; fill: var(--gold); display: block; margin: 0 auto .9rem; }
.event-title {
    font-family: var(--display); font-weight: 400;
    font-size: 1.45rem; letter-spacing: .04em; color: var(--emerald);
    margin-bottom: .8rem;
}
.event-date { font-weight: 500; font-size: 1.05rem; color: #1f2d27; margin-bottom: .2rem; }
.event-time { color: var(--gold-ink); font-weight: 600; letter-spacing: .12em; margin-bottom: .7rem; font-size: .98rem; }
.event-location { color: #56655d; font-size: 1rem; line-height: 1.55; }

/* ════════════════════════════
   MAP
════════════════════════════ */
.map-card {
    background: var(--paper);
    border: 1px solid rgba(143,108,38,.45);
    border-radius: 10px;
    box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px rgba(143,108,38,.25), 0 18px 40px rgba(15,76,62,.12);
    overflow: hidden;
    margin: 6px;
}
.map-info {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1.3rem 1.3rem 1.15rem;
    border-bottom: 1px solid rgba(143,108,38,.3);
}
.map-detail { display: flex; align-items: flex-start; gap: .75rem; flex: 1; min-width: 180px; }
.map-icon { color: var(--gold-d); flex-shrink: 0; margin-top: 3px; display: flex; }
.map-venue { font-family: var(--display); font-size: 1.15rem; color: var(--emerald); margin-bottom: .15rem; line-height: 1.4; }
.map-address { font-size: .95rem; color: var(--muted); line-height: 1.55; }
.btn-map-nav {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .7rem 1.5rem;
    background: var(--emerald); color: var(--gold-l);
    clip-path: var(--pointed);
    font-weight: 600; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: background .3s, color .3s;
}
.btn-map-nav:hover, .btn-map-nav:focus-visible { background: var(--gold); color: var(--emerald-dd); outline: none; }
.leaflet-map { width: 100%; height: 260px; display: block; }
.map-embed-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .6rem; height: 180px;
    background: var(--pat-light) center / 48px, var(--ivory);
    color: var(--emerald); text-decoration: none; font-weight: 500; letter-spacing: .06em;
    transition: background .3s, color .3s;
}
.map-embed-placeholder:hover { background: var(--emerald); color: var(--gold-l); }

/* ════════════════════════════
   GALLERY — mihrab arcade
════════════════════════════ */
.gallery-subtitle {
    text-align: center; font-family: var(--arabic); font-style: italic; color: var(--fg-muted);
    font-size: 1.1rem; margin: -1.1rem 0 1.8rem;
}
.gallery-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; }
.gallery-featured, .gallery-grid-item, .gallery-extra-item {
    position: relative; overflow: hidden; cursor: pointer;
    padding: 2px;
    background: var(--gold-flat);
    display: flex; align-items: center; justify-content: center;
    -webkit-mask: var(--mask-arch) center / 100% 100% no-repeat;
            mask: var(--mask-arch) center / 100% 100% no-repeat;
}
.gallery-featured { aspect-ratio: 3 / 4.3; }
.gallery-grid-side { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; }
.gallery-grid-item { min-height: 0; }
.gallery-extra-item { aspect-ratio: 3 / 4; }
.gallery-featured img, .gallery-grid-item img, .gallery-extra-item img {
    width: 100%; height: 100%; object-fit: cover;
    background: var(--emerald-d);
    -webkit-mask: var(--mask-arch) center / 100% 100% no-repeat;
            mask: var(--mask-arch) center / 100% 100% no-repeat;
    transition: transform .7s cubic-bezier(.16,1,.3,1);
}
.gallery-featured:hover img, .gallery-grid-item:hover img, .gallery-extra-item:hover img { transform: scale(1.06); }
.gallery-featured-overlay, .gallery-item-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(7,37,32,0);
    transition: background .3s;
}
.gallery-featured:hover .gallery-featured-overlay,
.gallery-grid-item:hover .gallery-item-overlay,
.gallery-extra-item:hover .gallery-item-overlay { background: rgba(7,37,32,.35); }
.gallery-featured-overlay svg, .gallery-item-overlay svg { opacity: 0; transition: opacity .3s; }
.gallery-featured:hover svg, .gallery-grid-item:hover svg, .gallery-extra-item:hover svg { opacity: 1; }
.gallery-row-extra {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr));
    gap: 8px; margin-top: 10px;
}
.gallery-featured.placeholder, .gallery-grid-item.placeholder {
    color: var(--gold-l); cursor: default;
    background: var(--pat-dark) center / 32px, linear-gradient(180deg, var(--emerald-l), var(--emerald-d));
}
.gallery-featured.placeholder svg, .gallery-grid-item.placeholder svg { opacity: .55; }

/* Lightbox */
.gallery-lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(7,37,32,.95);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity .3s;
}
.lb-img-wrap { max-width: min(90vw, 600px); max-height: 85vh; display: flex; align-items: center; justify-content: center; }
.lb-img-wrap img {
    max-width: 100%; max-height: 80vh; object-fit: contain;
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 5px rgba(7,37,32,.95), 0 0 0 6px rgba(201,162,74,.4), 0 30px 80px rgba(0,0,0,.6);
}
.lb-close, .lb-prev, .lb-next {
    position: fixed; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(201,162,74,.5); background: rgba(10,47,39,.75);
    color: var(--gold-l); cursor: pointer; border-radius: 50%;
    transition: background .2s, color .2s;
}
.lb-close { top: 1.25rem; right: 1.25rem; width: 42px; height: 42px; font-size: 1rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; }
.lb-prev { left: .75rem; }
.lb-next { right: .75rem; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--gold); color: var(--emerald-dd); }
.lb-counter {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    color: var(--gold-l); font-size: .85rem; letter-spacing: .25em;
    padding: 4px 16px; border: 1px solid rgba(201,162,74,.4); background: rgba(10,47,39,.75); border-radius: 999px;
}

/* ════════════════════════════
   GIFT SECTION OVERRIDE (ivory)
════════════════════════════ */
#gift-section {
    position: relative;
    background:
        var(--pat-light) center / 64px,
        radial-gradient(ellipse 85% 60% at 50% 42%, var(--ivory-2) 0%, var(--ivory) 55%, #f0e3c6 100%) !important;
    padding: var(--pad-section) 0 !important;
    min-height: auto !important;
}
#gift-section .gs-wrap { position: relative; z-index: 2; }
#gift-section .gs-heading h2 {
    color: var(--emerald) !important;
    font-family: var(--display) !important; font-weight: 400 !important;
    font-size: clamp(1.6rem, 6.4vw, 2.2rem) !important;
}
#gift-section .gs-heading h2::after { background: var(--gold) !important; width: 60px !important; }
#gift-section .gs-heading p { color: var(--muted) !important; font-family: var(--sans) !important; font-size: .98rem !important; }
#gift-section .gs-sub-label { color: var(--gold-ink) !important; }
#gift-section .gs-card, #gift-section .gs-bank-card {
    border-color: rgba(143,108,38,.35) !important;
    box-shadow: 0 10px 30px rgba(15,76,62,.1) !important;
}

/* ════════════════════════════
   WISHES
════════════════════════════ */
.rsvp-form-container {
    position: relative;
    max-width: 560px; margin: 1.4rem auto 2.4rem;
    padding: 2.4rem 1.5rem 1.7rem;
    background: var(--paper);
    border: 1px solid rgba(143,108,38,.45);
    border-radius: 12px;
    box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px rgba(143,108,38,.22), 0 20px 44px rgba(15,76,62,.12);
}
.form-badge {
    position: absolute; top: -24px; left: 50%; margin-left: -24px;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-flat); clip-path: var(--octa); isolation: isolate;
}
.form-badge::before { content: ''; position: absolute; inset: 2px; z-index: -1; background: var(--emerald); clip-path: var(--octa); }
.form-badge svg { width: 20px; height: 20px; fill: var(--gold-l); }
.input-row { margin-bottom: 1.3rem; }
.input-row > label {
    display: block; margin-bottom: .45rem;
    font-size: .74rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
    color: var(--gold-ink);
}
.input-row input[type="text"], .input-row textarea {
    width: 100%; padding: .85rem 1rem;
    background: #fffdf8; color: var(--text);
    border: 1px solid rgba(143,108,38,.4); border-radius: 8px;
    font-family: var(--sans); font-size: 1rem;
    transition: border-color .3s, box-shadow .3s;
}
.input-row input::placeholder, .input-row textarea::placeholder { color: #8a948e; }
.input-row input:focus, .input-row textarea:focus {
    outline: none; border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(15,76,62,.15);
}
.attend-options { display: flex; gap: .5rem; flex-wrap: wrap; }
.attend-opt {
    display: flex; align-items: center; gap: .45rem; cursor: pointer;
    padding: .45rem .85rem; border: 1px solid rgba(143,108,38,.35); border-radius: 999px;
    font-size: .95rem; color: var(--text);
    transition: border-color .3s, background .3s;
}
.attend-opt:hover { border-color: var(--emerald); }
.attend-opt:has(input:checked) { border-color: var(--emerald); background: rgba(15,76,62,.08); }
.attend-opt input[type="radio"] { accent-color: var(--emerald); width: 15px; height: 15px; }

.wishes-list { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: .85rem; }
.wish-item {
    display: flex; gap: .9rem; align-items: flex-start;
    padding: 1.05rem 1.1rem 1rem;
    background: rgba(255,250,240,.92);
    border: 1px solid rgba(143,108,38,.28);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15,76,62,.06);
}
.wish-avatar {
    width: 42px; height: 42px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--emerald); color: var(--gold-l);
    font-family: var(--display); font-size: 1.1rem;
    clip-path: var(--octa);
}
.wish-body { flex: 1; min-width: 0; }
.wish-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.wish-name { font-weight: 600; font-size: 1rem; color: var(--emerald); }
.wish-badge {
    font-size: .7rem; font-weight: 600; letter-spacing: .06em;
    padding: 1px 9px; border-radius: 999px; border: 1px solid currentColor;
}
.wish-badge.hadir { color: #1e7a4f; background: rgba(30,122,79,.08); }
.wish-badge.tidak { color: #a33a3a; background: rgba(163,58,58,.07); }
.wish-badge.ragu  { color: #8a5d0e; background: rgba(201,162,74,.12); }
.wish-message { font-size: .98rem; color: var(--text); line-height: 1.6; margin-bottom: .25rem; word-break: break-word; }
.wish-time { font-size: .82rem; color: var(--muted); }
.wish-empty { text-align: center; color: var(--muted); font-style: italic; padding: 2rem 0; }

/* ════════════════════════════
   FOOTER
════════════════════════════ */
.footer { text-align: center; align-items: center; padding-left: 1.5rem; padding-right: 1.5rem; }
.footer-inner { position: relative; z-index: 2; max-width: 460px; margin: 0 auto; }
.footer-names { margin-bottom: .8rem; }
.footer-doa {
    font-family: var(--arabic); font-size: clamp(1.15rem, 4.8vw, 1.4rem); line-height: 2;
    color: var(--gold-l); margin-bottom: .6rem;
}
.footer-copy { color: var(--fg-muted); font-size: 1rem; margin-bottom: 1.6rem; }
.footer-credit { margin-top: 2rem; font-size: .8rem; color: var(--fg-muted); opacity: .8; letter-spacing: .04em; }

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 520px) {
    .couple-flex { gap: .5rem; }
    .portrait { width: 100px; }
    .portrait-arch span { font-size: 2.4rem; }
    .ampersand { font-size: 2.4rem; padding-bottom: 4.5rem; }
    .parent { font-size: .9rem; }
    .countdown-star { gap: .5rem; }
    .map-info { flex-direction: column; align-items: stretch; }
    .btn-map-nav { width: 100%; }
    .rsvp-form-container { padding: 2.4rem 1.2rem 1.6rem; }

}
@media (max-width: 360px) {
    .portrait { width: 86px; }
    .hero-frame { padding-left: 1rem; padding-right: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .intro-ornamen, .orn-spin, .lamp-swing, .lamp-glow, .btn-gold::after, .intro-content > * { animation: none !important; }
    .btn-gold::after { display: none; }
    .ia-sparkles { display: none; }
    nav#mainNav, nav#mainNav a, nav#mainNav a::after { transition-duration: .01s !important; }
}

/* Footer clearance so content never sits behind the bottom nav */
main > footer.footer { padding-bottom: 96px; }
body:has(#qr-fab) main > footer.footer, body.has-qr main > footer.footer { padding-bottom: 160px; }
