:root {
    --primary: #b88c5d;
    --primary-soft: #f3e6d6;
    --bg: #faf7f2;
    --dark: #333;
    --muted: #777;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--dark);
    scroll-behavior: smooth;
    opacity: 0;
    animation: bodyFadeIn .8s ease-out forwards;
}

body.template-garden {
    --primary: #7f9a72;
    --primary-soft: #e5eddc;
    --bg: #f7f7f0;
    --dark: #283226;
    --muted: #68745f;
    background:
        linear-gradient(180deg, rgba(229, 237, 220, .8), rgba(247, 247, 240, .96)),
        var(--bg);
}

body.template-luxe {
    --primary: #d6b36a;
    --primary-soft: #42351e;
    --bg: #11100f;
    --dark: #f6efe1;
    --muted: #b6ab98;
    background: #11100f;
    color: var(--dark);
}

body.template-modern {
    --primary: #546a7b;
    --primary-soft: #e6ecef;
    --bg: #f8fafb;
    --dark: #1f2933;
    --muted: #687782;
    background: var(--bg);
}

a {
    text-decoration: none;
    color: inherit;
}

section {
    padding: 60px 16px;
}

.container {
    max-width: 960px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.mt-5 {
    margin-top: 32px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

/* ===== COVER ===== */
#cover {
    min-height: 100vh;
    padding: 0;
    position: relative;
    color: #fff;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

#cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.35);
    transform: scale(1.05);
}

#cover .overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 16px 40px;
}

#cover .top-badge {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.9;
}

#cover .monogram {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto 12px;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 28px;
    animation: floatMonogram 4s ease-in-out infinite;
}

#cover .names {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    line-height: 1.2;
    text-align: center;
}

#cover .ampersand {
    font-size: 26px;
    opacity: 0.9;
    margin: 4px 0;
}

#cover .date {
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 1px;
}

#cover .guest-box {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.33);
    padding: 14px 16px;
    border-radius: 16px;
    backdrop-filter: blur(6px);
}

#cover .guest-name {
    font-weight: 600;
    font-size: 15px;
    margin-top: 4px;
}

#cover .actions {
    margin-top: 28px;
}

#cover .scroll-indicator {
    margin-top: 32px;
    font-size: 11px;
    opacity: 0.8;
    text-align: center;
}

/* ===== GENERIC ===== */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    text-align: center;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    color: var(--muted);
    margin-bottom: 12px;
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.ayat {
    font-style: italic;
    font-size: 14px;
    line-height: 1.7;
}

.ayat-ref {
    margin-top: 8px;
    font-weight: 500;
    font-size: 13px;
}

/* COUNTDOWN */
.countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.count-item {
    width: 72px;
    padding: 10px 6px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.count-number {
    font-size: 18px;
    font-weight: 600;
}

.count-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

/* COUPLE */
.couple-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

.person {
    text-align: center;
}

.person-img {
    width: 140px;
    height: 140px;
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 4px solid #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.person-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-name {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
}

.person-detail {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.6;
}

.social-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--primary);
}

/* EVENTS */
.event-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
}

.event-card {
    border-radius: 18px;
    padding: 18px 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    align-items: center;
}

.event-date {
    text-align: center;
    border-right: 1px solid #eee;
    padding-right: 10px;
}

.event-day {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.event-month {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--primary);
}

.event-num {
    font-size: 26px;
    font-weight: 600;
    margin: 2px 0;
}

.event-year {
    font-size: 13px;
    color: var(--muted);
}

.event-info-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.event-time {
    font-size: 13px;
    color: var(--primary);
}

.event-location {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.6;
}

.event-actions {
    margin-top: 8px;
    font-size: 12px;
}

/* STORY */
.timeline {
    margin-top: 24px;
    border-left: 2px solid var(--primary-soft);
    padding-left: 16px;
}

.timeline-item {
    position: relative;
    margin-bottom: 18px;
    padding-left: 10px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
}

.timeline-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.timeline-title {
    font-size: 15px;
    font-weight: 500;
    margin-top: 2px;
}

.timeline-text {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.6;
}

/* GIFT */
.gift-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.gift-item {
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.gift-label {
    font-weight: 500;
}

.gift-number {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    margin-top: 4px;
}

.copy-btn {
    margin-top: 6px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px dashed var(--primary);
    padding: 3px 10px;
    display: inline-block;
    cursor: pointer;
}

/* FORM */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.form-control,
select,
textarea {
    width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.info-text {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.wishes-list {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.wish-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 8px;
}

.wish-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.wish-status {
    font-size: 11px;
    color: var(--primary);
    margin-bottom: 4px;
}

footer {
    padding: 30px 16px 40px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

footer .names {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    margin-top: 6px;
}

.footer {
    margin-top: 60px;
    padding: 32px 16px 24px;
    text-align: center;
    background: #fdfaf6;
    color: #555;
    font-size: 13px;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-title {
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #999;
}

.footer .names {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin: 6px 0;
    color: #333;
}

.footer .thanks {
    font-size: 13px;
    color: #777;
}

.footer-divider {
    width: 60px;
    height: 1px;
    background: #e0d6c8;
    margin: 20px auto;
}

.footer-powered {
    margin-top: 8px;
}

.powered-text {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.powered-logos {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.powered-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    text-decoration: none;
}

.powered-item img {
    height: 22px;
    width: auto;
    opacity: 0.85;
    transition: opacity .2s ease, transform .2s ease;
}

.powered-item:hover img {
    opacity: 1;
    transform: scale(1.05);
}

.powered-text {
    font-size: 12px;
    color: #777;
}

.powered-link {
    color: #b88c5d;
    text-decoration: none;
    transition: opacity .2s ease;
}

.powered-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}


/* ===== ANIMASI MASUK (scroll) ===== */
@keyframes bodyFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

[data-animate] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .7s ease-out, transform .7s ease-out;
}

[data-animate].in-view {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="zoom"] {
    transform: scale(.94);
}

[data-animate="zoom"].in-view {
    transform: scale(1);
}

[data-animate="fade-up-slow"] {
    transform: translateY(60px);
    transition-duration: 1s;
}

.delay-1 {
    transition-delay: .15s;
}

.delay-2 {
    transition-delay: .3s;
}

.delay-3 {
    transition-delay: .45s;
}

@keyframes floatMonogram {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ===== LOADER ===== */
#loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #f9efe2 0, #e7d3b7 45%, #b88c5d 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility .6s ease;
}

.loader-ring {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== BUTTON MUSIC ===== */
#music-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9000;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, opacity .3s ease;
    opacity: 0;
    pointer-events: none;
}

#music-toggle.visible {
    opacity: 1;
    pointer-events: auto;
}

#music-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

/* ===== LEAVES / PARTICLES ===== */
#leaf-container {
    pointer-events: none;
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 100;
}

.leaf {
    position: absolute;
    top: -10%;
    width: 18px;
    height: 10px;
    background: radial-gradient(circle at 30% 30%, #fff 0, #f9efe2 30%, #d9b88b 100%);
    border-radius: 60% 40% 60% 40%;
    opacity: 0.7;
    animation-name: fall, sway;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
}

@keyframes fall {
    to {
        transform: translateY(120vh) rotate(360deg);
    }
}

@keyframes sway {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(25px);
    }

    100% {
        transform: translateX(-10px);
    }
}

/* RESPONSIVE */
@media(min-width:768px) {
    section {
        padding: 80px 24px;
    }

    .couple-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .event-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .event-list:has(.event-card:only-child) {
        grid-template-columns: 1fr;
    }

    .event-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .event-date {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-right: 0;
        padding-bottom: 10px;
    }
}

/* ===== GALLERY ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease, filter .3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(.9);
}

.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

/* lightbox modal */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9500;
}

#lightbox-overlay.active {
    display: flex;
}

#lightbox-overlay img {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

#lightbox-overlay .close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===== TEMPLATE: GARDEN SOFT ===== */
body.template-garden section {
    position: relative;
}

body.template-garden #cover::before {
    filter: brightness(.66) saturate(.95);
}

body.template-garden #cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(30, 45, 28, .1), rgba(30, 45, 28, .58)),
        linear-gradient(90deg, rgba(247, 247, 240, .16), transparent 42%);
    z-index: 1;
}

body.template-garden #cover .overlay {
    justify-content: center;
    max-width: 760px;
    margin: 0 auto;
}

body.template-garden #cover .monogram,
body.template-garden .person-img {
    border-color: rgba(255, 255, 255, .92);
    box-shadow: 0 16px 34px rgba(40, 50, 38, .18);
}

body.template-garden .card,
body.template-garden .event-card,
body.template-garden .gift-item,
body.template-garden .wish-item,
body.template-garden .count-item {
    border: 1px solid rgba(127, 154, 114, .18);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(66, 88, 58, .08);
}

body.template-garden .section-subtitle {
    color: #7f9a72;
}

body.template-garden .footer {
    background: #edf3e8;
}

/* ===== TEMPLATE: LUXE DARK ===== */
body.template-luxe #cover::before {
    filter: brightness(.32) contrast(1.06) saturate(.82);
}

body.template-luxe #cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(17, 16, 15, .08), rgba(17, 16, 15, .84)),
        radial-gradient(circle at 50% 45%, transparent 0, rgba(0, 0, 0, .32) 72%);
}

body.template-luxe #cover .overlay {
    justify-content: center;
    padding-block: 48px;
}

body.template-luxe #cover .monogram {
    border-color: rgba(214, 179, 106, .86);
    color: #f9e5b6;
}

body.template-luxe #cover .guest-box {
    background: rgba(17, 16, 15, .62);
    border: 1px solid rgba(214, 179, 106, .36);
    border-radius: 6px;
}

body.template-luxe .card,
body.template-luxe .event-card,
body.template-luxe .gift-item,
body.template-luxe .wish-item,
body.template-luxe .count-item {
    background: #1b1917;
    border: 1px solid rgba(214, 179, 106, .22);
    border-radius: 6px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

body.template-luxe .event-date {
    border-color: rgba(214, 179, 106, .2);
}

body.template-luxe .form-control,
body.template-luxe select,
body.template-luxe textarea {
    color: #f6efe1;
    background: #141312;
    border-color: rgba(214, 179, 106, .26);
}

body.template-luxe .btn-outline {
    background: transparent;
}

body.template-luxe .footer {
    background: #0b0b0a;
    color: #b6ab98;
}

body.template-luxe .footer .names {
    color: #f6efe1;
}

/* ===== TEMPLATE: MODERN MINIMAL ===== */
body.template-modern section {
    padding-block: 52px;
}

body.template-modern #cover {
    min-height: 92vh;
    background: #1f2933;
}

body.template-modern #cover::before {
    inset: 18px;
    border-radius: 0;
    filter: brightness(.52) grayscale(.08);
    transform: none;
}

body.template-modern #cover::after {
    content: "";
    position: absolute;
    inset: 18px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, .36);
    pointer-events: none;
}

body.template-modern #cover .overlay {
    justify-content: flex-end;
    padding: 42px 34px 56px;
}

body.template-modern #cover .top-badge,
body.template-modern .section-subtitle,
body.template-modern .count-label {
    letter-spacing: 3px;
}

body.template-modern #cover .monogram {
    display: none;
}

body.template-modern #cover .names {
    font-size: 42px;
    max-width: 560px;
    margin: 0 auto;
}

body.template-modern #cover .guest-box {
    max-width: 440px;
    margin: 28px auto 0;
    border-radius: 0;
    background: rgba(248, 250, 251, .92);
    color: #1f2933;
}

body.template-modern .card,
body.template-modern .event-card,
body.template-modern .gift-item,
body.template-modern .wish-item,
body.template-modern .count-item {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #dce4e8;
}

body.template-modern .person-img,
body.template-modern .gallery-item {
    border-radius: 0;
    box-shadow: none;
}

body.template-modern .btn {
    border-radius: 0;
}

body.template-modern .footer {
    background: #edf2f5;
}
