:root {
    --bg-page: #F2F6F4;
    --bottle-green: #1E3F32;
    --bottle-green-mid: #2D5A48;
    --bottle-green-soft: #E4EDE8;
    --gold-accent: #C5A878;
    --text-main: #1A2923;
    --text-muted: #556860;
    --border-soft: #D3E0D9;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', sans-serif;

    --shadow-soft: 0 15px 40px rgba(30, 63, 50, 0.07);
    --shadow-hover: 0 22px 48px rgba(30, 63, 50, 0.13);
    --transition-smooth: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    overflow-x: hidden;
    margin: 0;
}

.font-serif-elegant {
    font-family: var(--font-serif);
}

/* ================= 1. VIDEO INTRO & COVER ================= */

#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #132A21;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition:
        transform 1s cubic-bezier(0.77, 0, 0.175, 1),
        opacity 0.9s ease;
}

#intro-overlay.opened {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

#intro-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.65);
    transform: scale(1.03);
    animation: videoReveal 12s ease-out forwards;
}

.video-backdrop-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at center,
            rgba(19, 42, 33, 0.35) 0%,
            rgba(12, 28, 22, 0.85) 100%
        );
    z-index: 2;
}

.intro-card {
    position: relative;
    z-index: 3;
    max-width: 440px;
    width: 90%;
    padding: 40px 28px;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
    opacity: 0;
    transform: translateY(25px) scale(0.97);
    transition:
        opacity 1.2s ease,
        transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-card.show-names {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: introFloat 5s ease-in-out 1.2s infinite;
}

#intro-card h1 {
    animation: textReveal 1s ease both;
}

#skip-video-btn {
    position: absolute;
    bottom: 28px;
    right: 28px;
    z-index: 4;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 9px 17px;
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

#skip-video-btn:hover {
    background: rgba(197, 168, 120, 0.3);
    border-color: var(--gold-accent);
    transform: translateY(-3px);
}

/* ================= 2. ANIMASI SCROLL ================= */

.scroll-animate {
    opacity: 0;
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.fade-up {
    transform: translateY(40px);
}

.fade-left {
    transform: translateX(-35px);
}

.fade-right {
    transform: translateX(35px);
}

.zoom-in {
    transform: scale(0.92);
}

.scroll-animate.in-view {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Efek muncul berurutan pada galeri */

.photo-frame:nth-child(1) {
    transition-delay: 0.05s;
}

.photo-frame:nth-child(2) {
    transition-delay: 0.12s;
}

.photo-frame:nth-child(3) {
    transition-delay: 0.19s;
}

.photo-frame:nth-child(4) {
    transition-delay: 0.26s;
}

.photo-frame:nth-child(5) {
    transition-delay: 0.33s;
}

.photo-frame:nth-child(6) {
    transition-delay: 0.40s;
}

.photo-frame:nth-child(7) {
    transition-delay: 0.47s;
}

.photo-frame:nth-child(8) {
    transition-delay: 0.54s;
}

/* ================= 3. KARTU UTAMA ================= */

.elegant-card {
    background: #FFFFFF;
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    transition:
        box-shadow 0.45s ease,
        border-color 0.45s ease,
        transform 0.45s ease;
}

.elegant-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(197, 168, 120, 0.5);
}

/* ================= 4. FOTO & GALERI ================= */

.photo-frame {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background-color: var(--bottle-green-soft);
    border: 1px solid var(--border-soft);
    cursor: pointer;
    isolation: isolate;
}

.photo-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(19, 42, 33, 0.18),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-frame:hover img {
    transform: scale(1.07);
}

.photo-frame:hover::after {
    opacity: 1;
}

/* Bingkai foto mempelai */

.arch-frame {
    border-radius: 140px 140px 24px 24px;
    overflow: hidden;
    border: 4px solid #FFFFFF;
    box-shadow: 0 12px 30px rgba(30, 63, 50, 0.14);
    transition:
        transform 0.5s ease,
        box-shadow 0.5s ease;
}

.arch-frame:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px rgba(30, 63, 50, 0.2);
}

.arch-frame img {
    transition: transform 0.8s ease;
}

.arch-frame:hover img {
    transform: scale(1.05);
}

/* ================= 5. TOMBOL ================= */

.btn-bottle {
    background-color: var(--bottle-green);
    color: #FFFFFF;
    border-radius: 999px;
    transition:
        background-color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.btn-bottle:hover {
    background-color: #142C22;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(30, 63, 50, 0.25);
}

.btn-bottle:active {
    transform: translateY(-1px) scale(0.98);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold-accent);
    outline-offset: 4px;
}

/* ================= 6. FORM RSVP & UCAPAN ================= */

input,
select,
textarea {
    font-family: var(--font-sans);
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #9EB7A9;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--bottle-green);
    box-shadow: 0 0 0 4px rgba(30, 63, 50, 0.08);
    background-color: #FFFFFF;
}

/* ================= 7. COUNTDOWN ================= */

#countdown > div {
    transition:
        transform 0.3s ease,
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

#countdown > div:hover {
    transform: translateY(-4px);
    background-color: #D8E6DE;
    box-shadow: 0 8px 18px rgba(30, 63, 50, 0.08);
}

/* ================= 8. LIGHTBOX ================= */

#lightbox-modal {
    opacity: 0;
    transition: opacity 0.35s ease;
}

#lightbox-modal:not(.hidden) {
    opacity: 1;
    animation: lightboxFadeIn 0.35s ease forwards;
}

#lightbox-img {
    animation: lightboxImageIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#lightbox-modal button {
    transition:
        background-color 0.3s ease,
        transform 0.3s ease;
}

#lightbox-modal button:hover {
    transform: translateY(-2px);
}

/* ================= 9. CUSTOM SCROLLBAR ================= */

.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: #B9CCC2 transparent;
}

.custom-scroll::-webkit-scrollbar {
    width: 5px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #B9CCC2;
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--bottle-green-mid);
}

/* ================= 10. ANIMASI TAMBAHAN ================= */

@keyframes videoReveal {
    from {
        transform: scale(1.03);
    }
    to {
        transform: scale(1.10);
    }
}

@keyframes introFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes lightboxImageIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================= 11. RESPONSIVE ================= */

/* Dasar mobile (Android & iOS) */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

@supports (overflow: clip) {
    html,
    body {
        overflow-x: clip;
    }
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior-y: none;
}

img,
video {
    max-width: 100%;
}

button,
a,
.photo-frame,
select {
    touch-action: manipulation;
}

/* Overlay intro: aman untuk notch, address bar iOS, dan layar landscape */

#intro-overlay {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding:
        env(safe-area-inset-top)
        env(safe-area-inset-right)
        env(safe-area-inset-bottom)
        env(safe-area-inset-left);
}

#intro-video,
.video-backdrop-gradient {
    position: fixed;
}

.intro-card {
    margin: auto;
    will-change: transform, opacity;
}

#skip-video-btn {
    position: fixed;
    min-height: 44px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
}

/* Tombol musik & area bawah */

#music-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
}

#main-content {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

/* Lightbox */

#lightbox-modal {
    padding:
        max(1rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
}

#lightbox-img {
    max-height: 80vh;
    max-height: 80dvh;
}

#lightbox-modal button {
    min-height: 44px;
}

#wishes-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Form: hindari auto-zoom iOS Safari (font input harus >= 16px) */

input,
select,
textarea {
    font-size: 16px !important;
    min-height: 48px;
    border-radius: 12px;
}

textarea {
    resize: vertical;
    min-height: 96px;
}

input,
textarea {
    -webkit-appearance: none;
    appearance: none;
}

select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231E3F32' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* Target sentuh minimal 44px */

.btn-bottle,
button[onclick^="copyRekening"],
#main-content a[href^="http"] {
    min-height: 44px;
}

/* Perangkat sentuh: matikan efek hover agar tidak "menempel" di iOS/Android */

@media (hover: none) {
    .elegant-card:hover,
    .arch-frame:hover,
    .btn-bottle:hover,
    #countdown > div:hover,
    #skip-video-btn:hover,
    #lightbox-modal button:hover {
        transform: none;
        box-shadow: var(--shadow-soft);
    }

    .arch-frame:hover {
        box-shadow: 0 12px 30px rgba(30, 63, 50, 0.14);
    }

    .btn-bottle:hover {
        background-color: var(--bottle-green);
        box-shadow: none;
    }

    #countdown > div:hover {
        background-color: #E4EDE8;
        box-shadow: none;
    }

    .photo-frame:hover img,
    .arch-frame:hover img {
        transform: none;
    }

    .photo-frame:hover::after {
        opacity: 0;
    }

    .btn-bottle:active {
        transform: scale(0.98);
    }
}

@media (max-width: 700px) {
    .elegant-card {
        border-radius: 22px;
    }

    .intro-card {
        padding: 32px 22px;
    }

    .photo-frame {
        border-radius: 16px;
    }

    /* Animasi geser horizontal diganti naik agar tidak memicu scroll samping */
    .fade-left,
    .fade-right {
        transform: translateY(30px);
    }

}

/* HP kecil (<= 380px: iPhone SE, Android compact) */

@media (max-width: 380px) {
    .elegant-card[class*="p-7"] {
        padding: 1.25rem;
    }

    .intro-card {
        padding: 26px 16px;
        width: 92%;
    }

    #countdown {
        gap: 0.4rem;
    }

    #countdown small {
        font-size: 10px;
        letter-spacing: 0.04em;
    }

    #intro-card h1 {
        font-size: 2rem;
    }

    .arch-frame {
        border-radius: 110px 110px 20px 20px;
    }
}

/* Layar landscape / pendek */

@media (max-height: 520px) and (orientation: landscape) {
    .intro-card {
        max-width: 560px;
        padding: 18px 20px;
        margin: 12px auto;
    }

    #intro-card h1 {
        font-size: 2rem;
    }

    #skip-video-btn {
        bottom: 12px;
    }
}

/* Tablet & desktop: kolom konten sedikit lebih lega */

@media (min-width: 1024px) {
    #main-content {
        max-width: 44rem;
    }
}

/* ================= 12. AKSESIBILITAS ================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .scroll-animate {
        opacity: 1;
        transform: none;
    }
}
/* ================= 14. CERITA KAMI (TIMELINE) ================= */

.story-timeline {
    position: relative;
    list-style: none;
    margin: 0 auto;
    padding: 0 0 0 2.4rem;
    max-width: 30rem;
    text-align: left;
}

/* Garis vertikal emas */
.story-timeline::before {
    content: "";
    position: absolute;
    left: calc(0.7rem - 1px);
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(
        to bottom,
        rgba(197, 168, 120, 0),
        rgba(197, 168, 120, 0.85) 10%,
        rgba(197, 168, 120, 0.85) 90%,
        rgba(197, 168, 120, 0)
    );
}

.story-item {
    position: relative;
    padding-bottom: 2.1rem;
}

.story-item:last-child {
    padding-bottom: 0;
}

/* Titik di garis */
.story-dot {
    position: absolute;
    left: -2.4rem;
    top: 0.2rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--gold-accent);
    box-shadow: 0 0 0 5px rgba(197, 168, 120, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-dot::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--gold-accent);
}

/* Titik terakhir ("Hari Ini") dipenuhi emas agar menonjol */
.story-item--now .story-dot {
    background: var(--gold-accent);
    box-shadow: 0 0 0 6px rgba(197, 168, 120, 0.25);
}

.story-item--now .story-dot::after {
    background: #FFFFFF;
}

.story-date {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold-accent);
}

.story-title {
    margin: 0.15rem 0 0.45rem;
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.2;
    color: #1E3F32; /* hijau botol tua (variabel --bottle-green di tema ini bernilai mint) */
}

.story-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--text-muted);
}

@media (max-width: 380px) {
    .story-timeline {
        padding-left: 2.1rem;
    }

    .story-dot {
        left: -2.1rem;
    }

    .story-title {
        font-size: 1.35rem;
    }
}