/* ============================================================
   UNDANGAN PERNIKAHAN ADAT MINANGKABAU
   Token: marun #5C1A1A / #7A2222, emas #D4AF37, krem #F5E6C8
   ============================================================ */

:root {
    --maroon-dark: #3D0F0F;
    --maroon: #5C1A1A;
    --maroon-light: #7A2222;
    --gold: #D4AF37;
    --gold-light: #E8C766;
    --gold-soft: #C9A961;
    --cream: #F5E6C8;
    --cream-dim: #E8D9B5;
    --bg-deep: #1A0E08;
    --bg-card: #2B1208;
    --ink: #120802;

    --font-display: 'Cormorant Garamond', serif;
    --font-script: 'Tangerine', cursive;
    --font-body: 'Poppins', sans-serif;

    --shadow-deep: 0 20px 50px rgba(0,0,0,0.6);
    --shadow-gold: 0 0 0 1px rgba(212,175,55,0.3), 0 10px 30px rgba(0,0,0,0.5);

    --bg-minang-tile: url('../assets/bg-minang.jpg');
}

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--cream);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
}

/* Background bertekstur ukiran Minang, diulang vertikal menyambung
   tiap section agar motif tidak terpotong di tengah */
#main-content {
    background-image: var(--bg-minang-tile);
    background-repeat: repeat-y;
    background-size: 100% auto;
    background-position: top center;
}

/* Lapisan gelap transparan di atas background foto agar teks tetap
   terbaca jelas tanpa menghilangkan motif */
#main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(26,14,8,0.88) 0%,
        rgba(26,14,8,0.93) 100%);
    pointer-events: none;
    z-index: 0;
}

#main-content > * { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

.serif { font-family: var(--font-display); }
.handwriting { font-family: var(--font-script); }

::selection { background: var(--gold); color: var(--ink); }

/* ============ SCROLLBAR GLOBAL ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 10px; }

/* ============ MOTIF LENGKUNG ISTANA (signature shape) ============
   Lengkung satu puncak runcing, senada motif arch pada bg-minang.jpg —
   dipakai untuk frame foto & divider. SVG mask untuk kurva yang presisi. */
.arch-frame {
    position: relative;
    width: 210px;
    height: 250px;
    margin: 0 auto;
    filter: drop-shadow(0 14px 26px rgba(0,0,0,0.6));
}

.arch-frame .arch-clip {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    overflow: hidden;
    position: relative;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.arch-frame .arch-clip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arch-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    border: 3px solid var(--gold);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z' fill='none' stroke='white' stroke-width='6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z' fill='none' stroke='white' stroke-width='6'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    pointer-events: none;
}

/* Divider kecil bermotif lengkung, dipakai antar section */
.gonjong-divider {
    width: 44px;
    height: 28px;
    margin: 24px auto;
    background: var(--gold);
    clip-path: polygon(
        50% 0%, 30% 14%, 18% 28%, 8% 45%, 0% 65%,
        0% 100%, 100% 100%, 100% 65%, 92% 45%, 82% 28%, 70% 14%
    );
    opacity: 0.85;
}

/* ============ MUSIC BUTTON ============ */
.music-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--maroon) 75%);
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: var(--shadow-gold);
    color: var(--cream);
    font-size: 1.1rem;
    animation: spin-disc 5s linear infinite;
}
.music-btn.paused { animation-play-state: paused; }
@keyframes spin-disc { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }

/* ============ COVER ============ */
#cover {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-deep);
    background-image: var(--bg-minang-tile);
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    transition: transform 1.1s cubic-bezier(.77,0,.18,1);
    overflow-y: auto;
    padding: 40px 20px;
}

.overlay-cover {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(26,14,8,0.45) 0%,
        rgba(26,14,8,0.55) 45%,
        rgba(26,14,8,0.8) 100%);
    pointer-events: none;
}

.cover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 420px;
    margin: auto;
}

.cover-content h4 {
    font-family: var(--font-display);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--gold-soft);
    margin-bottom: 24px;
    font-weight: 600;
}

.cover-frame {
    width: 220px;
    height: 260px;
    margin: 0 auto 18px;
    position: relative;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}
.cover-frame::before {
    content: '';
    position: absolute;
    inset: -7px;
    background: linear-gradient(160deg, var(--gold-light), var(--gold-soft) 50%, var(--maroon-light));
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    z-index: 0;
}
.cover-frame img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 250'%3E%3Cpath d='M105 0 C70 0 60 28 45 40 C25 56 0 70 0 105 L0 250 L210 250 L210 105 C210 70 185 56 165 40 C150 28 140 0 105 0 Z'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.cover-content h1 {
    font-size: 3.4rem;
    color: var(--gold-light);
    margin: 6px 0 18px;
    line-height: 1;
    text-shadow: 0 4px 18px rgba(212,175,55,0.35);
}

.cover-content > p {
    font-size: 0.85rem;
    color: var(--cream-dim);
    margin-bottom: 6px;
}

.guest-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--cream);
    padding: 10px 0 26px;
    border-bottom: 1px solid rgba(212,175,55,0.3);
    margin: 0 auto 26px;
    max-width: 280px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-soft));
    color: var(--ink);
    border: none;
    border-radius: 40px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 24px rgba(212,175,55,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212,175,55,0.45); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gold);
    color: var(--gold-light);
    box-shadow: none;
}
.btn-outline:hover {
    background: rgba(212,175,55,0.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ============ MAIN CONTENT ============ */
#main-content {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 40px;
}

section {
    padding: 70px 24px;
    text-align: center;
    position: relative;
}

.section-title {
    font-size: 2.1rem;
    color: var(--gold-light);
    margin-bottom: 6px;
    font-weight: 600;
}

#opening .section-title { margin-bottom: 20px; }

/* ============ COUPLE SECTION ============ */
.couple-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    margin-top: 30px;
}

.person { max-width: 320px; }

.batik-frame { margin-bottom: 18px; }

.name-title {
    font-size: 1.7rem;
    color: var(--cream);
    margin-bottom: 8px;
    font-weight: 600;
}

.ortu-text {
    font-size: 0.85rem;
    color: var(--cream-dim);
    line-height: 1.6;
    margin-bottom: 10px;
    padding: 0 10px;
}

.ig-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gold-soft);
    border: 1px solid rgba(212,175,55,0.35);
    padding: 6px 16px;
    border-radius: 30px;
    transition: 0.3s;
}
.ig-link:hover { background: rgba(212,175,55,0.1); border-color: var(--gold); }

.ampersand {
    font-family: var(--font-script);
    font-size: 3.2rem;
    color: var(--gold);
    line-height: 0.5;
}

/* ============ COUNTDOWN ============ */
.timer-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0 40px;
    flex-wrap: wrap;
}

.time-box {
    background: var(--bg-card);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 12px;
    padding: 14px 10px;
    min-width: 68px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.time-box span {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
}

.time-box p {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cream-dim);
    margin-top: 6px;
}

/* ============ EVENT CARDS ============ */
.event-card {
    background: linear-gradient(165deg, var(--bg-card), var(--maroon-dark));
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 18px;
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-deep);
    position: relative;
    overflow: hidden;
}
.event-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.event-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 16px;
    font-weight: 700;
}

.event-card p {
    font-size: 0.9rem;
    color: var(--cream-dim);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: left;
}
.event-card p i { color: var(--gold); width: 16px; flex-shrink: 0; }

/* ============ GIFT SECTION ============ */
.gift-card-red {
    background: linear-gradient(155deg, var(--maroon), var(--maroon-dark));
    border: 1px solid rgba(212,175,55,0.5);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    text-align: left;
    box-shadow: var(--shadow-deep);
}

.bank-name {
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rek-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--cream);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.atas-nama {
    font-size: 0.8rem;
    color: var(--cream-dim);
    margin-bottom: 16px;
}

.btn-salin {
    background: rgba(212,175,55,0.15);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 500;
    float: left;
    transition: 0.3s;
}
.btn-salin:hover { background: rgba(212,175,55,0.3); }

/* ============ RSVP & CHAT ============ */
.rsvp-container {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--gold);
    border-radius: 18px;
    padding: 32px 22px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-deep);
}

#chat-form input,
#chat-form select,
#chat-form textarea {
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,175,55,0.4);
    color: var(--cream);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: 0.3s;
}
#chat-form input::placeholder,
#chat-form textarea::placeholder { color: rgba(245,230,200,0.45); }

#chat-form input:focus,
#chat-form select:focus,
#chat-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255,255,255,0.1);
}
#chat-form select option { background: var(--bg-card); color: var(--cream); }

.chat-box {
    margin-top: 28px;
    max-height: 380px;
    overflow-y: auto;
    text-align: left;
    padding-right: 8px;
}

.chat-msg {
    background: rgba(255,255,255,0.04);
    border-left: 3px solid var(--gold);
    padding: 16px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 14px;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg h4 {
    color: var(--gold-light);
    font-size: 1rem;
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.chat-msg p { font-size: 0.88rem; color: var(--cream-dim); line-height: 1.55; }
.chat-time {
    font-size: 0.72rem;
    color: rgba(245,230,200,0.4);
    display: block;
    margin-top: 10px;
    text-align: right;
    font-style: italic;
}

.badge-status {
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-hadir { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid #4ade80; }
.badge-absen { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid #f87171; }

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 60px 24px 40px;
    border-top: 1px solid rgba(212,175,55,0.25);
    margin-top: 30px;
}
footer p { font-size: 0.85rem; color: var(--cream-dim); }
footer h3 { font-size: 2.6rem; color: var(--gold-light); }

/* ============ RESPONSIVE ============ */
@media (min-width: 700px) {
    .couple-wrapper { flex-direction: row; justify-content: center; align-items: center; gap: 50px; }
    .gift-card-red, .event-card { padding: 32px; }
}

@media (max-width: 380px) {
    .cover-content h1 { font-size: 2.7rem; }
    .time-box { min-width: 58px; padding: 10px 6px; }
    .time-box span { font-size: 1.4rem; }
}