/* 
   Tema: Refactored Dynamic Section Layout (Berbasis Whimsical Extended)
   Pendekatan Ekstra: Full Width Thematic Block, Raster Image Decor (.webp), Kinerja Ultra-Ringan
*/

:root {
    /* Palet Warna Extended yang Harmonis */
    --color-sage-light: #DFE5DA;
    /* Pale sage sangat lembut untuk hero & footer */
    --color-sage-deep: #475D52;
    /* Warna berat, kaya & kontras untuk Akad */
    --color-sand: #F7EFE8;
    /* Warm sand pastel untuk warna base netral */
    --color-terra-dusty: #DDA795;
    /* Dusty terracotta untuk seksi transisional */
    --color-terra-deep: #A3503C;
    /* Soft namun dalam untuk garis/tekanan logis */
    --color-lavender: #E4DDEC;
    /* Warna lavender pucat untuk panel kutipan */

    /* Tipografi Teks & Warna Tambahan Section */
    --color-charcoal: #363F3C;
    --color-charcoal-light: #5A6460;
    --color-white: #FFFFFF;
    --color-cream: #FCFBF7;
    /* Background salam & undangan */
    --color-emerald: #1B3B36;
    /* Emerald green kaya untuk background event */
    --color-ivory: #FFFFEA;
    /* White ivory untuk teks informasi acara */

    /* Konfigurasi Hierarki Kuat */
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    --font-cursive: 'Great Vibes', cursive;
}

/* === Reset & Base Element === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-charcoal-light);
    line-height: 1.8;
    /* Desktop Gutter Soft Gradient (muted light hero gradient) */
    background: linear-gradient(135deg, #e4ebda 0%, #ebe2d6 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* === MOBILE-FIRST DESKTOP WRAPPER === */
.app-wrapper {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--color-sand);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.12);
    /* Elevasi Halus */
    position: relative;
    overflow-x: hidden;
    /* Mencegah elemen luber keluar pinggir 'HP' */
}

/* === Typography Utilities === */
.text-cursive {
    font-family: var(--font-cursive);
    font-size: 1.45em;
    /* Dipaksa lebih dominan membesar agar imbang dengan huruf normal sans-serif */
    font-weight: 400;
    white-space: nowrap;
    /* Teks jangan terputus pindah baris jika terpotong panjang kata */
    padding: 0 3px;
    /* color: var(--color-terra-deep); Opsional jika ingin ganti warna khusus bisa dimasukkan disini nanti */
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-charcoal);
    font-weight: 500;
}

.title {
    font-size: 4.2rem;
    line-height: 1.05;
    margin: 1.2rem 0;
    font-style: italic;
    color: inherit;
}

.subtitle {
    font-size: 0.9rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 500;
    color: inherit;
    /* Memberi kontras alami via opasitas */
    opacity: 0.75;
}

.date {
    font-size: 1.3rem;
    letter-spacing: 2px;
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: inherit;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 2.5rem;
    font-style: italic;
    position: relative;
    color: inherit;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 1px;
    background-color: var(--color-terra-deep);
    margin: 1.2rem auto 0;
    opacity: 0.6;
}

/* === Layout Basis Seksi Utama (Dynamic) === */
.section {
    position: relative;
    /* Memberikan ruang napas super luas yang diinginkan gaya Whimsical */
    padding: 7rem 1.5rem;
    text-align: center;
    /* Overflows disembunyikan agar ornamen tidak meluber jika memotong margin */
    overflow: hidden;
    z-index: 1;
}

.content {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    z-index: 5;
}

/* === Aset Dekorasi Raster (.webp/.png) === */
.decor-img {
    position: absolute;
    z-index: 2;
    /* Elemen tak bisa diklik/highlight secara tak sengaja */
    pointer-events: none;
    opacity: 0.85;
    /* Responsif membesar maksimal setara kanvas kecil */
    width: 60vw;
    max-width: 350px;
    object-fit: contain;
}

/* Placement Utilities untuk Aset Ornamen Raster */
.top-left {
    top: -8%;
    left: -10%;
    transform: rotate(10deg);
}

.top-right {
    top: -5%;
    right: -12%;
    transform: rotate(-15deg);
}

.bottom-left {
    bottom: -5%;
    left: -10%;
    transform: rotate(90deg);
}

.bottom-right {
    bottom: -8%;
    right: -12%;
    transform: rotate(-10deg);
}

/* Jika ornamen dilampirkan pada section bertema latar gelap */
.decor-light {
    /* Meningkatkan keterangan ornamen raster untuk muncul di warna sage deep */
    filter: brightness(1.5) contrast(0.9) opacity(0.6);
}

/* ========================================================= */
/* === PENGGAYAAN TEMATIK UNTUK MASING-MASING SECTION ====== */
/* ========================================================= */

/* === SEAMLESS TOP GROUP (Hero, Quote, Invitation) === */
.seamless-top-group {
    background: linear-gradient(135deg, var(--color-sage-light) 0%, var(--color-sand) 100%);
}

/* 1. Hero Section (Wallpaper Mobile Fit) */
.hero-section {
    position: relative;
    height: 100dvh;
    /* Sangat persis dengan area aman layar browser mobile */
    max-width: 480px;
    /* Lock area sentral */
    margin: 0 auto;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    /* Padding ekstra agar menjorok menjauhi bingkai */
    z-index: 1;
}

/* Background Frame Terpisah Untuk Animasi Independen Harmoni */
.hero-frame-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;

    /* Frame Luxury Ornament difusi sebagai CSS Background Utama dengan Fallback */
    background-image: url('../img/photo-frame.png');
    background-image: -webkit-image-set(url('../img/photo-frame.webp') 1x, url('../img/photo-frame.png') 1x);
    background-image: image-set(url('../img/photo-frame.webp') type('image/webp'), url('../img/photo-frame.png') type('image/png'));
    background-size: 100% 100%;
    /* Stretch persis ke dimensi container */
    background-position: center;
    background-repeat: no-repeat;
}

/* Base Hidden Animasi Khusus Layer Frame */
.hero-frame-anim {
    will-change: opacity, transform;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1), transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-frame-anim.is-hidden {
    opacity: 0;
    transform: scale(0.93);
    /* Efek Soft Scale-in / Zoom Perlahan */
}

/* Format Hero Name: 2 Baris Menggunakan Flexbox */
.hero-name-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    margin: 1.5rem 0;
}

.hero-name-stack .ampersand {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    color: var(--color-terra-deep);
    /* Aksen kontras teredam */
    margin: 0.8rem 0;
    opacity: 0.7;
}

/* 2. Quote Section (The Break) */
.quote-section {
    background-color: var(--color-terra-dusty);
    color: var(--color-white);
    padding-top: 6rem;
    padding-bottom: 6rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.03), 0 10px 40px rgba(0, 0, 0, 0.03);
}

.quote-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.quote-source {
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.line-spacing {
    padding: 0 1rem;
}

/* === GALLERY COLLAGE SECTION === */
.collage-section {
    background-color: transparent;
    padding-top: 2rem;
    padding-bottom: 5rem;
}

.collage-wrapper {
    position: relative;
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
    aspect-ratio: 1/1;
    /* Memastikan tumpukan tidak hancur ditiap layar HP */
}

.collage-item {
    position: absolute;
    object-fit: cover;
}

/* Styling Polaroid Kustom CSS Murni */
.polaroid-style {
    border: 8px solid #FFFFFF;
    border-radius: 2px;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #FFFFFF;
}

/* Transformasi, Penempatan Z-Index Polaroid Sesuai Pesanan */
.photo-bg {
    width: 65%;
    height: 75%;
    top: 15%;
    right: 5%;
    transform: rotate(4deg);
    z-index: 1;
}

.photo-main {
    width: 70%;
    height: 80%;
    top: 5%;
    left: 5%;
    transform: rotate(-6deg);
    z-index: 2;
}

/* Efek Nafas Organik (Tertiup Angin) pada Ornamen Kolase */
@keyframes flowerBreath {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.03) rotate(0.8deg);
    }
}

@keyframes scribbleBreath {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.02) rotate(-0.5deg);
    }
}

.accent-flower {
    width: 45%;
    top: -8%;
    right: -10%;
    z-index: 3;
    pointer-events: none;
    will-change: transform;
    transform-origin: center right;
    animation: flowerBreath 8s ease-in-out infinite;
}

.accent-scribble {
    width: 35%;
    bottom: -5%;
    left: -2%;
    z-index: 4;
    pointer-events: none;
    will-change: transform;
    transform-origin: bottom left;
    animation: scribbleBreath 10s ease-in-out infinite;
    animation-delay: 2s;
    /* Jeda waktu agar ayunan kedua ornamen tidak sama */
}

/* === INVITATION TEXT SECTION === */
.invitation-section {
    background-color: transparent;
    color: var(--color-charcoal);
    padding-top: 3rem;
    padding-bottom: 7rem;
}

.invitation-para {
    font-size: 1.15rem;
    line-height: 2.2;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* === EVENTS GROUP SECTION (Emerald Green) === */
.events-group-section {
    background-color: var(--color-emerald);
    color: var(--color-ivory);
    padding: 9rem 1.5rem;
}

.events-group-section .section-title::after {
    background-color: #D4AF37;
    /* Garis emas tepi */
}

/* Efek Teks Emas (Linear Gradient) */
.gold-text {
    background: linear-gradient(to right, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #D4AF37;
    /* Fallback solid gold aksen terang */
    font-weight: 600;
}

.ivory-text {
    color: var(--color-ivory);
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3.5rem;
    margin-top: 4rem;
}

.event-card-item {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 234, 0.25);
    /* Garis border elegan ivory */
    border-radius: 12px;
    padding: 4rem 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    /* Float shadow */
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
}

.event-card-item .decor-img {
    width: 60%;
    opacity: 0.15;
    /* Blur rendah supaya ornamen tidak menutupi huruf emas */
    z-index: -1;
}

.event-title {
    font-size: 2.2rem;
    font-style: italic;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

/* Utilitas Detail Event Card */
.event-day {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.9;
}

.event-date {
    font-size: 2.6rem;
    font-family: var(--font-heading);
    margin: 0.8rem 0;
}

.event-time {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.event-location {
    font-size: 0.95rem;
    line-height: 1.6;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 234, 0.25);
    display: block;
    margin-top: 1rem;
}

.event-location strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.4rem;
}

/* Responsive Desktop Grid dihapus agar flex/grid tetap stacked di container sempit 480px */

/* 5. RSVP Section */
.rsvp-section {
    background-color: var(--color-sand);
    padding-bottom: 5rem;
}

.rsvp-text {
    margin-bottom: 3.5rem;
    font-size: 0.95rem;
    padding: 0 1rem;
}

/* 6. Footer Section */
.footer-section {
    background-color: var(--color-sage-light);
    padding-top: 5rem;
    padding-bottom: 9rem;
}

.footer-text {
    font-size: 1.15rem;
    margin-bottom: 4rem;
}

.footer-closing {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-style: italic;
}

.footer-title {
    font-size: 3.5rem;
    margin-top: 1rem;
    font-style: italic;
}

/* === DESAIN TOMBOL ELEGAN (CSS MURNI) === */
.btn-primary {
    background: var(--color-charcoal);
    color: var(--color-sand);
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: var(--color-terra-deep);
    color: var(--color-white);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* === ANIMASI & COVER SCREEN OVERLAY === */
.cover-screen {
    position: fixed;
    inset: 0;
    /* Kembalikan ke format Edge-to-Edge Adaptive */
    width: 100%;
    max-width: none;
    /* Hapus limitasi lebar dimensi seluler */
    margin: 0;
    background: linear-gradient(135deg, var(--color-sage-light) 0%, var(--color-sand) 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Transisi sesuai logika main.js dari user */
    transition: opacity 1.2s ease, visibility 1.2s ease, transform 1.2s ease;
}

/* State Disembunyikan oleh classList.add('hide') dari Js */
.cover-screen.hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.03);
    /* Transisi sangat smooth yang elegan menyorot kedepan */
}

.cover-content {
    text-align: center;
    z-index: 10;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
}

.cover-to {
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--color-charcoal-light);
}

.guest-name {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-style: italic;
    margin-bottom: 3rem;
    line-height: 1.1;
    color: var(--color-charcoal);
}

/* Padding/Font besar desktop dihapus agar proportional di container seluler 480px */

/* ========================================================= */
/* === ANIMASI INTERAKTIF MURNI (SCROLL & ENTRANCE) ======== */
/* ========================================================= */

.scroll-zoom,
.scroll-slide-left,
.scroll-slide-right,
.scroll-fade-up,
.scroll-decor,
.hero-fade-up,
.hero-decor {
    will-change: opacity, transform, margin-top;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Hidden States yang disuntikkan via JS (progressive enhancement support) */
.scroll-zoom.is-hidden {
    opacity: 0;
    transform: scale(0.92);
}

.scroll-slide-left.is-hidden {
    opacity: 0;
    transform: translateX(-40px);
}

.scroll-slide-right.is-hidden {
    opacity: 0;
    transform: translateX(40px);
}

.scroll-fade-up.is-hidden,
.hero-fade-up.is-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.scroll-decor.is-hidden,
.hero-decor.is-hidden {
    opacity: 0 !important;
    margin-top: 25px !important;
}