/* ==========================================================================
   THEME: DESAIN 29 - TROPICAL GOLD STONE
   KitoNgundang Wedding Invitation
   ========================================================================== */

:root {
    --ivory: #f6f1e9;
    --gold: #b8924e;
    --gold-light: #e3c27c;
    --brass: #8f6a38;
    --brass-dark: #6f5128;
    --emerald: #24423c;
    --emerald-deep: #1b332e;
    --leaf: #4d7468;
    --tan: #c9ac85;
    --ink: #303333;
    --muted: #565d5b;
    --ivory-text: #efe6d6;
    --line: rgba(143, 106, 56, 0.34);
    --bg-body: #2c3a36;

    --font-display: 'Berkshire Swash', Georgia, serif;
    --font-serif: 'Averia Serif Libre', Georgia, serif;
    --font-body: 'Figtree', sans-serif;
    --font-arab: 'Amiri', serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
    --spring: cubic-bezier(0.34, 1.5, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body.locked {
    overflow: hidden;
    height: 100vh;
}

img {
    display: block;
    max-width: 100%;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
}

/* ---------- Elemen dekoratif ---------- */
.deco {
    pointer-events: none;
    user-select: none;
}

/* retakan emas di atas batu */
.cracks {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url('../images/cracks.svg') center / 100% 100% no-repeat;
}

/* dedaunan sudut: pembungkus mengatur posisi dan pembalikan, gambar bergoyang dari pangkal */
.fol {
    position: absolute;
    z-index: 1;
    display: block;
    width: var(--w, 240px);
}

.fol img {
    width: 100%;
    height: auto;
    transform-origin: 5% 98%;
    animation: sway var(--sway, 8s) ease-in-out var(--sd, 0s) infinite;
}

/* debu emas */
.dust {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.dust i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff6d8 0 30%, rgba(227, 194, 124, 0.7) 55%, rgba(227, 194, 124, 0) 72%);
    box-shadow: 0 0 8px rgba(227, 194, 124, 0.9);
    opacity: 0;
    animation: twinkle 4.4s ease-in-out var(--d, 0s) infinite;
}

/* ---------- Tombol kuningan ---------- */
.btn-brass {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, #9b7542 0%, var(--brass) 100%);
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.85rem 2.1rem;
    border-radius: 4px 18px 4px 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(111, 81, 40, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-brass::before,
.rb-body::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.34) 50%, transparent 70%);
    transform: translateX(-130%);
    transition: transform 0.9s var(--ease);
}

.btn-brass:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(111, 81, 40, 0.38);
}

.btn-brass:hover::before {
    transform: translateX(130%);
}

.btn-brass:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.btn-block {
    width: 100%;
}

/* tombol berbentuk pita (ekor pita di kiri dan kanan) */
.btn-ribbon {
    position: relative;
    isolation: isolate;
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-ribbon::before,
.btn-ribbon::after {
    content: '';
    position: absolute;
    top: 9px;
    width: 34px;
    height: 100%;
    background: var(--brass-dark);
    z-index: -1;
}

.btn-ribbon::before {
    left: -24px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%);
}

.btn-ribbon::after {
    right: -24px;
    clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%);
}

.rb-body {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 2.4rem;
    background: linear-gradient(180deg, #9b7542, var(--brass));
    color: #ffffff;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(111, 81, 40, 0.32);
}

.btn-ribbon:hover {
    transform: translateY(-2px);
}

.btn-ribbon:hover .rb-body::before {
    transform: translateX(130%);
}

.btn-ribbon:active {
    transform: scale(0.97);
}

/* ==========================================================================
   COVER
   ========================================================================== */
#cover {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%);
    z-index: 9999;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 44%, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0) 62%),
        var(--ivory) url('../images/stone.svg') center top / 480px 720px;
    clip-path: circle(150% at 50% 38%);
    transition:
        clip-path 1.7s var(--ease-io),
        visibility 0s linear 1.7s;
}

/* dibuka: sampul menutup ke tengah seperti rana kamera */
#cover.opened {
    clip-path: circle(0% at 50% 38%);
    visibility: hidden;
    pointer-events: none;
}

#cover.opened .iris-photo {
    transform: scale(1.1);
    transition: transform 1.6s var(--ease-io);
}

#cover .cracks {
    animation: crackDraw 2.8s var(--ease) 0.2s backwards;
}

/* dedaunan di empat sudut */
.fol-bl {
    --w: 280px;
    left: -34px;
    bottom: -34px;
}

.fol-br {
    --w: 280px;
    right: -34px;
    bottom: -34px;
    transform: scaleX(-1);
}

.fol-br img {
    --sway: 9.5s;
    --sd: -2.5s;
}

.fol-tl {
    --w: 200px;
    left: -50px;
    top: -46px;
    transform: scaleY(-1);
}

.fol-tl img {
    --sway: 10s;
    --sd: -4s;
}

.fol-tr {
    --w: 200px;
    right: -50px;
    top: -46px;
    transform: rotate(180deg);
}

.fol-tr img {
    --sway: 8.5s;
    --sd: -1s;
}

.cover-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.3rem, 1.5dvh, 0.9rem);
    padding: 3dvh 1.5rem;
    text-align: center;
}

.cover-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.iris-photo {
    --ring: min(54vw, clamp(140px, 27dvh, 220px));
    position: relative;
    width: var(--ring);
    height: var(--ring);
    margin: clamp(0.4rem, 2dvh, 1.1rem) 0 clamp(0.5rem, 2.2dvh, 1.2rem);
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 0 0 4px #ffffff,
        0 0 0 5.5px var(--gold),
        0 0 0 9px rgba(255, 255, 255, 0.55),
        0 16px 30px rgba(36, 66, 60, 0.26);
    animation: popIn 1.4s var(--ease) 0.45s backwards;
}

.iris-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    animation: iris 1.8s var(--ease-io) 0.7s backwards;
}

.cover-names {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 6.4dvh, 2.7rem);
    line-height: 1.2;
    white-space: nowrap;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cover-to {
    font-size: 0.85rem;
    color: var(--ink);
}

.cover-guest-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--brass);
    word-break: break-word;
}

.cover-guest {
    max-width: 300px;
    margin-bottom: clamp(0.4rem, 1.6dvh, 1rem);
}

/* ==========================================================================
   LAYOUT UMUM
   ========================================================================== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--ivory) url('../images/stone.svg') center top / 480px 720px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
}

section {
    position: relative;
    padding: 4.5rem 1.75rem;
    text-align: center;
    overflow: hidden;
}

section > *:not(.deco) {
    position: relative;
    z-index: 1;
}

/* judul bagian di atas pita */
.sec-title {
    position: relative;
    isolation: isolate;
    display: table;
    margin: 0 auto 2.1rem;
    padding: 0.45rem 2.6rem;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.55rem;
    line-height: 1.3;
    white-space: nowrap;
    color: #ffffff;
    background: linear-gradient(180deg, #9b7542, var(--brass));
    box-shadow: 0 8px 14px rgba(111, 81, 40, 0.25);
}

.sec-title::before,
.sec-title::after {
    content: '';
    position: absolute;
    top: 11px;
    width: 34px;
    height: 100%;
    background: var(--brass-dark);
    z-index: -1;
}

.sec-title::before {
    left: -24px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%);
}

.sec-title::after {
    right: -24px;
    clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%);
}

.lead {
    font-size: 0.93rem;
    color: var(--muted);
    max-width: 340px;
    margin: 0 auto;
}

/* retakan emas pembatas antarbagian */
.crack {
    height: 36px;
    margin: -1.1rem 0;
    position: relative;
    z-index: 2;
    background: url('../images/crack-divider.svg') center / 100% 100% no-repeat;
    pointer-events: none;
}

/* bagian zamrud tua */
section.dark {
    background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-deep) 100%);
    color: var(--ivory-text);
    box-shadow: inset 0 3px 0 rgba(184, 146, 78, 0.55), inset 0 -3px 0 rgba(184, 146, 78, 0.55);
}

section.dark::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.45;
    background: url('../images/cracks.svg') center top / 100% auto repeat-y;
    pointer-events: none;
}

.dark .lead {
    color: #cdd9d1;
}

/* ==========================================================================
   HERO
   ========================================================================== */
#home {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 3.5rem;
    padding-bottom: 6rem;
}

#home .cracks {
    opacity: 0.55;
}

.fol-hero-bl {
    --w: 250px;
    left: -44px;
    bottom: -42px;
}

.fol-hero-tr {
    --w: 190px;
    right: -50px;
    top: -42px;
    transform: rotate(180deg);
}

.hero-seq {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.script-sm {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-style: italic;
    font-weight: 400;
    color: var(--brass);
}

.hero-names {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.1rem, 9.5vw, 2.7rem);
    line-height: 1.25;
    color: var(--ink);
    white-space: nowrap;
}

.hero-date {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brass);
    margin-top: 0.1rem;
}

/* bingkai berbentuk daun: dua sudut berlawanan membulat penuh */
.leaf-frame {
    position: relative;
    width: min(54vw, 206px);
    aspect-ratio: 4 / 5;
    margin: 0 auto 2.2rem;
    border-radius: 112px 8px 112px 8px;
}

.leaf-frame > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    box-shadow:
        0 0 0 4px #ffffff,
        0 14px 26px rgba(36, 66, 60, 0.26);
}

.leaf-frame::before {
    content: '';
    position: absolute;
    inset: -11px;
    border: 1.5px solid var(--gold);
    border-radius: 124px 16px 124px 16px;
    pointer-events: none;
}

.leaf-b {
    border-radius: 8px 112px 8px 112px;
}

.leaf-b::before {
    border-radius: 16px 124px 16px 124px;
}

.leaf-hero {
    width: min(62vw, 242px);
    margin: 0.9rem auto 1.7rem;
}

/* sepasang daun kecil yang menyembul di sudut bingkai */
.leaf-pin {
    position: absolute;
    z-index: 3;
    width: 70px;
    height: 56px;
    pointer-events: none;
}

.leaf-pin::before,
.leaf-pin::after {
    content: '';
    position: absolute;
    width: 42px;
    height: 22px;
    border-radius: 0 100% 0 100%;
    background:
        linear-gradient(135deg, transparent 46%, rgba(223, 238, 225, 0.9) 48% 52%, transparent 54%),
        linear-gradient(120deg, #1f4036, var(--leaf));
    box-shadow: 0 4px 8px rgba(36, 66, 60, 0.25);
}

.pin-a {
    right: -26px;
    bottom: -18px;
}

.pin-a::before { right: 4px; bottom: 6px; transform: rotate(-20deg); }
.pin-a::after  { right: 22px; bottom: 0; transform: rotate(18deg) scale(0.85); }

.pin-b {
    left: -26px;
    top: -14px;
}

.pin-b::before { left: 4px; top: 6px; transform: rotate(160deg); }
.pin-b::after  { left: 22px; top: 0; transform: rotate(198deg) scale(0.85); }

body.locked .hero-seq > * {
    opacity: 0;
}

body.opened .hero-seq > * {
    animation: riseSoft 1.5s var(--ease) backwards;
}

body.opened .hero-seq > :nth-child(1) { animation-delay: 0.7s; }
body.opened .hero-seq > :nth-child(2) { animation-delay: 0.95s; }
body.opened .hero-seq > :nth-child(3) { animation-delay: 1.3s; }
body.opened .hero-seq > :nth-child(4) { animation-delay: 1.55s; }

body.locked #home .cracks,
body.locked #home .fol {
    opacity: 0;
}

body.opened #home .cracks {
    animation: crackDraw 2.6s var(--ease) 0.6s backwards;
}

body.opened #home .fol img {
    animation: unfurl 1.9s var(--spring) 0.9s backwards, sway var(--sway, 8s) ease-in-out var(--sd, 0s) infinite;
}

/* ==========================================================================
   PEMBUKAAN
   ========================================================================== */
#opening {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

.salam {
    font-family: var(--font-arab);
    font-size: 1.7rem;
    line-height: 1.9;
    color: var(--brass);
    margin-bottom: 1rem;
}

.ayat {
    margin: 2.4rem auto 0;
    padding: 1.8rem 0;
    max-width: 360px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ayat-ar {
    font-family: var(--font-arab);
    font-size: 1.45rem;
    line-height: 2.3;
    color: var(--ink);
}

.ayat-id {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
    margin-top: 0.9rem;
}

.ayat cite {
    display: block;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brass);
    margin-top: 1rem;
}

/* ==========================================================================
   MEMPELAI
   ========================================================================== */
.person {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.person-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2.3rem;
    line-height: 1.3;
    color: var(--ink);
}

.person-full {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    font-style: italic;
    color: var(--brass);
    margin-bottom: 0.7rem;
}

.person-parents {
    font-size: 0.87rem;
    line-height: 1.75;
    color: var(--muted);
}

.person-parents strong {
    font-weight: 600;
    color: var(--ink);
}

.person-ig {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 1rem;
    padding-bottom: 2px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--brass);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    transition: color 0.3s, border-color 0.3s;
}

.person-ig:hover {
    color: var(--ink);
    border-color: var(--brass);
}

.amp {
    font-family: var(--font-display);
    font-size: 3.2rem;
    line-height: 1;
    color: var(--gold);
    margin: 1.8rem 0;
}

/* ==========================================================================
   ACARA
   ========================================================================== */
.sec-date {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-top: -0.5rem;
}

/* hitung mundur: lencana zamrud bergaris emas */
.countdown {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin: 1.8rem 0 1rem;
}

.cd-item {
    width: 68px;
    height: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #3a6a5c, #1b332e);
    box-shadow:
        0 0 0 2px var(--gold),
        0 0 0 5px rgba(27, 51, 46, 0.9),
        0 0 0 6.5px rgba(184, 146, 78, 0.6),
        0 10px 16px rgba(0, 0, 0, 0.3);
}

.cd-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ivory-text);
    font-variant-numeric: tabular-nums;
}

.cd-label {
    display: block;
    font-size: 0.62rem;
    color: var(--gold-light);
    margin-top: 0.2rem;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    margin-top: 2.4rem;
}

.event-card,
.bank-card {
    transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}

.event-card:hover,
.bank-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 36px rgba(0, 0, 0, 0.32);
}

.event-card {
    padding: 2.8rem 1.5rem 2.1rem;
    border: 1px solid rgba(184, 146, 78, 0.7);
    border-radius: 72px 6px 72px 6px;
    background: var(--ivory) url('../images/stone.svg') center top / 480px 720px;
    color: var(--ink);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.event-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.3;
    color: var(--emerald);
}

.event-time {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brass);
}

.event-place {
    font-size: 0.97rem;
    font-weight: 600;
    margin-top: 0.9rem;
}

.event-addr {
    font-size: 0.85rem;
    color: var(--muted);
    max-width: 260px;
    margin: 0.1rem auto 1.4rem;
}

/* ==========================================================================
   KISAH & SUSUNAN ACARA
   ========================================================================== */
.timeline {
    position: relative;
    list-style: none;
    max-width: 340px;
    margin: 0 auto;
    text-align: left;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 10px;
    bottom: 10px;
    width: 1.5px;
    background: linear-gradient(180deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
}

.timeline li {
    position: relative;
    padding-left: 2.4rem;
    margin-bottom: 2.1rem;
}

.timeline li:last-child {
    margin-bottom: 0;
}

/* penanda berbentuk daun */
.timeline li::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0.5rem;
    width: 17px;
    height: 17px;
    border-radius: 0 100% 0 100%;
    background: linear-gradient(135deg, var(--leaf), var(--emerald));
    box-shadow: 0 0 0 4px var(--ivory);
}

.tl-year {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    font-style: italic;
    color: var(--brass);
    line-height: 1.3;
}

.timeline h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.timeline p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.rundown {
    list-style: none;
    max-width: 330px;
    margin: 0 auto;
    text-align: left;
}

.rundown li {
    display: grid;
    grid-template-columns: 4.4rem 1fr;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.rundown li:last-child {
    border-bottom: 0;
}

.rd-time {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brass);
    font-variant-numeric: tabular-nums;
}

.rd-text {
    font-size: 0.93rem;
    color: var(--ink);
}

/* ==========================================================================
   GALERI (bingkai daun bergantian)
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.g-item {
    display: block;
    padding: 0;
    border: 0;
    overflow: hidden;
    cursor: zoom-in;
    aspect-ratio: 1;
    border-radius: 56px 6px 56px 6px;
    background: var(--ink);
    box-shadow:
        0 0 0 2px #ffffff,
        0 0 0 3.5px rgba(184, 146, 78, 0.85),
        0 12px 20px rgba(36, 66, 60, 0.24);
}

.g-item:nth-child(even) {
    border-radius: 6px 56px 6px 56px;
}

.g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease);
}

.g-item:hover img {
    transform: scale(1.07);
}

.g-tall {
    grid-row: span 2;
    aspect-ratio: auto;
    height: 100%;
    border-radius: 92px 8px 92px 8px;
}

.g-wide {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
    border-radius: 8px 72px 8px 72px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 28, 25, 0.95);
}

.lightbox[hidden] {
    display: none;
}

.lightbox:not([hidden]) {
    animation: fadeIn 0.4s ease;
}

.lb-img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 0 0 2px var(--gold);
}

.lb-img.swap {
    animation: lbImg 0.6s var(--ease);
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(227, 194, 124, 0.6);
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold-light);
    font-size: 1rem;
    cursor: pointer;
}

.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 10px; top: 50%; transform: translateY(-50%); }

.lb-close:focus-visible,
.lb-prev:focus-visible,
.lb-next:focus-visible {
    outline-color: var(--gold-light);
}

/* ==========================================================================
   TANDA KASIH
   ========================================================================== */
.bank-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 340px;
    margin: 2rem auto 0;
}

.bank-card {
    padding: 1.7rem 1.25rem 1.5rem;
    border: 1px solid rgba(184, 146, 78, 0.7);
    border-radius: 6px 44px 6px 44px;
    background: var(--ivory) url('../images/stone.svg') center top / 480px 720px;
    color: var(--ink);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

.bank-name {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--emerald);
    line-height: 1.2;
}

.bank-number {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    margin-top: 0.5rem;
}

.bank-holder {
    font-size: 0.86rem;
    color: var(--muted);
}

.btn-copy {
    margin-top: 1rem;
    padding: 0.5rem 1.3rem;
    border-radius: 3px 14px 3px 14px;
    border: 1px solid var(--brass);
    background: transparent;
    color: var(--brass);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.btn-copy:hover {
    background: var(--brass);
    color: #ffffff;
}

/* ==========================================================================
   RSVP & UCAPAN
   ========================================================================== */
.rsvp-form {
    max-width: 380px;
    margin: 0 auto;
    text-align: left;
}

.field {
    margin-bottom: 1.1rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brass);
    margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 4px 14px 4px 14px;
    background: rgba(255, 255, 255, 0.8);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--ink);
}

.field textarea {
    resize: vertical;
}

.wishes-feed {
    max-width: 380px;
    max-height: 420px;
    margin: 2.4rem auto 0;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow-y: auto;
    text-align: left;
}

.wish-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 4px 24px 4px 24px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 4px 10px rgba(36, 66, 60, 0.08);
}

.wish-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.wish-author {
    font-size: 0.92rem;
    font-weight: 600;
}

.wish-status {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--leaf);
}

.wish-status-no {
    color: #8a5448;
}

.wish-new {
    animation: wishIn 0.9s var(--ease);
}

.wish-text {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   PENUTUP
   ========================================================================== */
.closing {
    position: relative;
    overflow: hidden;
    padding: 5rem 1.75rem 12.5rem;
    text-align: center;
    color: var(--ivory-text);
    background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-deep) 100%);
    box-shadow: inset 0 3px 0 rgba(184, 146, 78, 0.55);
}

.closing .cracks {
    opacity: 0.45;
}

.closing > *:not(.deco) {
    position: relative;
    z-index: 2;
}

.fol-cl {
    --w: 230px;
    left: -76px;
    bottom: -68px;
}

.fol-cr {
    --w: 230px;
    right: -76px;
    bottom: -68px;
    transform: scaleX(-1);
}

.fol-cr img {
    --sway: 9.5s;
    --sd: -3s;
}

.closing .fol img {
    filter: brightness(1.4) saturate(1.05);
}

.closing-text {
    max-width: 330px;
    margin: 0 auto 1.8rem;
    font-size: 0.9rem;
    line-height: 1.75;
    color: #d3ded6;
}

.closing-regards {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--gold-light);
}

.closing-names {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 10vw, 2.9rem);
    line-height: 1.3;
    color: var(--gold-light);
    white-space: nowrap;
}

.footer-credit {
    margin-top: 2rem;
    font-size: 0.76rem;
    color: #bccbc2;
}

.footer-credit i {
    color: var(--gold);
}

.footer-credit a {
    color: var(--gold-light);
    font-weight: 600;
    text-decoration: none;
}

/* ==========================================================================
   MUSIK & NAVIGASI BAWAH (gaya sama dengan desain 16-28)
   ========================================================================== */
#music-btn {
    position: fixed;
    top: 18px;
    right: max(18px, calc(50% - 240px + 18px));
    width: 42px;
    height: 42px;
    border: 1px solid rgba(239, 230, 214, 0.7);
    border-radius: 50%;
    background: rgba(143, 106, 56, 0.95);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    animation: rotateMusic 4s linear infinite;
}

#music-btn.paused {
    animation-play-state: paused;
    opacity: 0.88;
}

#music-btn::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid rgba(239, 230, 214, 0.95);
    opacity: 0;
    pointer-events: none;
}

#music-btn:not(.paused)::after {
    animation: ripple 2.4s var(--ease) infinite;
}

.bottom-nav {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(143, 106, 56, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(239, 230, 214, 0.45);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    display: flex;
    gap: clamp(0.7rem, 3.6vw, 1.5rem);
    z-index: 998;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.nav-item {
    color: #f1e3c8;
    text-decoration: none;
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: color 0.3s, transform 0.3s;
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-item.active,
.nav-item:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.nav-item:focus-visible {
    outline-color: #ffffff;
}

body.opened .bottom-nav {
    animation: navIn 1.2s cubic-bezier(0.34, 1.45, 0.64, 1) 1.9s backwards;
}

.nav-item.active i {
    animation: navPop 0.55s cubic-bezier(0.34, 1.8, 0.64, 1);
}

/* ==========================================================================
   ANIMASI
   Konsep: angin tropis dan emas yang mengalir. Gerak masuk memakai easing
   "keluar cepat, berhenti pelan"; tiap jenis elemen punya gaya sendiri.
   ========================================================================== */
@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

@keyframes riseSoft {
    from { opacity: 0; transform: translateY(26px) scale(0.98); filter: blur(7px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}

/* nama: naik sambil sedikit miring, lalu menetap */
@keyframes nameIn {
    from { opacity: 0; transform: translateY(16px) skewX(-9deg); filter: blur(5px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes crackDraw {
    from { clip-path: inset(0 0 100% 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.86); }
    to   { opacity: 1; transform: none; }
}

/* foto membuka seperti iris */
@keyframes iris {
    from { clip-path: circle(0% at 50% 50%); }
    to   { clip-path: circle(75% at 50% 50%); }
}

@keyframes unfurl {
    from { opacity: 0; scale: 0.3; }
    to   { opacity: 1; scale: 1; }
}

@keyframes sway {
    0%, 100% { rotate: -1.6deg; }
    50%      { rotate: 2.4deg; }
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%      { opacity: 1; transform: scale(1.3); }
}

@keyframes ribbonIn {
    from { opacity: 0; transform: scaleX(0.15); }
    to   { opacity: 1; transform: none; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 8px 18px rgba(111, 81, 40, 0.32), 0 0 0 0 rgba(184, 146, 78, 0.45); }
    50%      { box-shadow: 0 8px 18px rgba(111, 81, 40, 0.32), 0 0 0 11px rgba(184, 146, 78, 0); }
}

@keyframes rotateMusic {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes ripple {
    from { transform: scale(1); opacity: 0.7; }
    to   { transform: scale(1.9); opacity: 0; }
}

@keyframes navIn {
    from { transform: translate(-50%, 160%); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes navPop {
    0%   { transform: scale(0.7); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lbImg {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: none; }
}

@keyframes wishIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.97); background: rgba(227, 194, 124, 0.55); }
    to   { opacity: 1; transform: none; }
}

@keyframes tick {
    from { opacity: 0.25; transform: translateY(-9px); }
    to   { opacity: 1; transform: none; }
}

/* sampul masuk bertahap */
.cv {
    animation: rise 1.1s var(--ease) var(--d, 0s) backwards;
}

#cover .cover-names {
    animation: nameIn 1.5s var(--ease) var(--d, 1.2s) backwards;
}

#cover .fol img {
    animation: unfurl 2s var(--spring) 0.9s backwards, sway var(--sway, 8s) ease-in-out var(--sd, 0s) infinite;
}

#btn-open {
    animation: ribbonIn 1.3s var(--ease) var(--d, 0s) backwards;
}

#btn-open .rb-body {
    animation: glow 2.8s ease-in-out 3.6s infinite;
}

#cover.opened .cover-title,
#cover.opened .cover-guest,
#cover.opened #btn-open,
#cover.opened .cover-names {
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* muncul saat digulir: kelas .js dipasang oleh script.js, atribut data-reveal diberi otomatis */
.js [data-reveal] {
    opacity: 0;
    transition:
        opacity 1s var(--ease) var(--d, 0s),
        transform 1.2s var(--ease) var(--d, 0s),
        scale 1.4s var(--spring) var(--d, 0s),
        rotate 1.4s var(--spring) var(--d, 0s),
        clip-path 1.5s var(--ease-io) var(--d, 0s);
}

.js [data-reveal="up"]     { transform: translateY(28px); }
.js [data-reveal="card"]   { transform: translateY(46px) scale(0.96); }
.js [data-reveal="pop"]    { transform: scale(0.9); }
.js [data-reveal="amp"]    { transform: scale(0.5) rotate(-14deg); }
.js [data-reveal="leaf"]   { transform: translateY(34px) scale(0.55) rotate(-9deg); transform-origin: 0% 100%; }
.js [data-reveal="medal"]  { transform: scale(0.35) rotate(-150deg); transition-timing-function: var(--spring); }
.js [data-reveal="ribbon"] { opacity: 1; clip-path: inset(-6px 50% -20px 50%); }
.js [data-reveal="crack"]  { opacity: 1; clip-path: inset(0 100% 0 0); }
.js [data-reveal="line"]   { opacity: 1; }

.js [data-reveal="medal"] {
    transition:
        opacity 0.8s var(--ease) var(--d, 0s),
        transform 1.5s var(--spring) var(--d, 0s);
}

.js [data-reveal="line"]::before {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 2s var(--ease-io) var(--d, 0s);
}

.js [data-reveal].in {
    opacity: 1;
}

.js [data-reveal="up"].in,
.js [data-reveal="card"].in,
.js [data-reveal="pop"].in,
.js [data-reveal="amp"].in,
.js [data-reveal="leaf"].in,
.js [data-reveal="medal"].in {
    transform: none;
}

.js [data-reveal="ribbon"].in {
    clip-path: inset(-6px -50px -20px -50px);
}

.js [data-reveal="crack"].in {
    clip-path: inset(0 0 0 0);
}

.js [data-reveal="line"].in::before {
    transform: scaleY(1);
}

.cd-number.tick {
    animation: tick 0.55s var(--ease);
}

/* ==========================================================================
   RESPONSIF & AKSESIBILITAS
   ========================================================================== */
/* layar pendek: dedaunan sampul dikecilkan agar tidak menumpuk di tombol */
@media (max-height: 640px) {
    #cover .fol-bl,
    #cover .fol-br {
        --w: 220px;
    }

    #cover .fol-tl,
    #cover .fol-tr {
        --w: 170px;
    }
}

@media (max-width: 360px) {
    section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .bottom-nav {
        padding: 0.45rem 0.9rem;
    }

    .nav-item {
        font-size: 0.66rem;
    }

    .cd-item {
        width: 58px;
        height: 58px;
    }

    .cd-number {
        font-size: 1.25rem;
    }

    .sec-title {
        padding-left: 2rem;
        padding-right: 2rem;
        font-size: 1.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .dust {
        display: none;
    }

    #cover {
        clip-path: none;
    }

    body.locked .hero-seq > *,
    body.locked #home .cracks,
    body.locked #home .fol,
    .js [data-reveal] {
        opacity: 1;
        clip-path: none;
    }

    .js [data-reveal="up"],
    .js [data-reveal="card"],
    .js [data-reveal="pop"],
    .js [data-reveal="amp"],
    .js [data-reveal="leaf"],
    .js [data-reveal="medal"] {
        transform: none;
    }
}
