@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Montserrat:wght@300;400;600&display=swap');

:root {
    --primary-lilac: #d9c5e2;
    --primary-rose: #f4cfdf;
    --bg-light: #fdfbfb;
    --text-dark: #3a3a3a;
    --accent-gold: #c5a059;
    --pastel-yellow: #fff9e6;
    --pastel-gray: #f2f2f2;
    --pastel-coffee: #ede0d4;
    --white: #ffffff;
    --black: #1a1a1a;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
}

/* Gallery Section Redesign - Preserving Aspect Ratios */
.gallery-grid {
    display: block;
    column-count: 3;
    column-gap: 20px;
    margin-top: 50px;
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
    }
}

/* Gallery Magic Reveal Effect */
.gallery-item-magic {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--pastel-gray);
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(40px);
    filter: blur(10px);
    transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform, opacity, filter;
}

.gallery-item-magic.reveal-magic {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.gallery-item-magic img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-item-magic.reveal-magic {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

.gallery-item-magic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-item-magic:hover img {
    transform: scale(1.1);
}

.gallery-item-magic.tall { grid-row: span 2; }
.gallery-item-magic.wide { grid-column: span 2; }

.story-text {
    max-width: 700px;
    margin: 0 auto 30px;
    font-style: italic;
    line-height: 1.8;
    color: #555;
    font-family: 'Montserrat', sans-serif;
}

.placeholder-img {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.section-padding {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* Hero Section */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -1;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 10px;
    letter-spacing: 5px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Countdown */
.countdown-container {
    padding: 40px 0;
    background: #fff;
    display: flex;
    justify-content: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.countdown-item {
    display: flex;
    flex-direction: column;
}

.countdown-value {
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    color: var(--accent-gold);
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

/* Details Section */
.details-card {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    margin: 0 auto;
    max-width: 800px;
}

.details-card h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--accent-gold);
}

.info-row {
    margin-bottom: 30px;
}

.info-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
    display: block;
}

.info-value {
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* Program Timeline */
.timeline {
    position: relative;
    max-width: 600px;
    margin: 20px auto 10px;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 1px;
    background: var(--primary-rose);
    top: 5px;
    bottom: 5px;
    left: 20px;
}
.timeline-item {
    padding: 0 0 15px 45px;
    position: relative;
    width: 100%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary-rose);
    left: 15px;
    top: 5px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    background: none;
    padding: 0;
    border-radius: 0;
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--accent-gold);
}

.timeline-content p {
    font-size: 0.95rem;
    margin: 3px 0 0 0;
    color: #888;
}

.story-chapter {
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeIn 1.5s ease-out;
}

.story-chapter p {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.aesthetic-divider {
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    margin: 15px auto;
}

/* Dress Code Section - Simplified */
.dress-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.dress-content-left, .dress-content-right {
    flex: 1;
    padding: 20px;
}

.dress-content-left {
    text-align: right;
}

.dress-content-right {
    text-align: left;
}

.dress-content-left h3, .dress-content-right h3 {
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.dress-content-left p, .dress-content-right p {
    font-size: 1.1rem;
    color: #555;
    font-weight: 300;
}

.dress-image-wrapper {
    flex: 1.5;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
}

.dress-main-img {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 0 auto;
}

/* Color Swatches */
.color-palette {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    flex-shrink: 0;
}

.swatch::after {
    content: attr(data-name);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--text-dark);
    font-weight: 500;
}

.restriction-note {
    margin-top: 60px;
    background: #fef1f2;
    padding: 20px;
    border-left: 5px solid #ef4444;
    font-style: italic;
    color: #b91c1c;
    display: inline-block;
    border-radius: 0 10px 10px 0;
}

/* RSVP Form */
.rsvp {
    background: var(--pastel-coffee);
}

.rsvp-form {
    max-width: 600px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--accent-gold);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background: #b08d4a;
    letter-spacing: 1px;
}

/* Footer & Maps */
footer {
    padding: 50px 20px;
    background: var(--text-dark);
    color: white;
    text-align: center;
}

.map-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary-rose);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-rose);
}

@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; text-align: left !important; }
    .timeline-item::after { left: 21px; }
    .right { left: 0%; }
    
    .dress-code-container {
        flex-direction: column;
        gap: 20px;
    }
    .dress-content-left, .dress-content-right {
        text-align: center;
        order: 2;
    }
    .dress-image-wrapper {
        order: 1;
        width: 100%;
    }
}
/* --- MAGIC BOOK COVER OVERLAY --- */
#book-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    perspective: 1200px;
}

body.book-opened {
    overflow-y: auto;
}
body:not(.book-opened) {
    overflow-y: hidden;
}

.book-door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-image: url('book-leather.png');
    background-size: cover;
    background-position: center;
    background-color: #113620; /* Deep emerald fallback */
    transition: transform 1.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow: inset 0 0 80px rgba(0,0,0,0.9);
    transform-style: preserve-3d;
}

.book-door::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 25px;
    left: 25px;
    right: 25px;
    border: 3px double rgba(218, 177, 98, 0.9);
    border-radius: 8px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(218, 177, 98, 0.3);
}

.book-door::after {
    content: '';
    position: absolute;
    top: 40px;
    bottom: 40px;
    left: 40px;
    right: 40px;
    border: 1px solid rgba(218, 177, 98, 0.5);
    pointer-events: none;
}

.left-door {
    left: 0;
    transform-origin: left center;
    border-right: 2px solid rgba(0,0,0,0.8);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5), inset 0 0 80px rgba(0,0,0,0.9);
}

.right-door {
    right: 0;
    transform-origin: right center;
    border-left: 2px solid rgba(0,0,0,0.8);
    background-position: right center;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5), inset 0 0 80px rgba(0,0,0,0.9);
}

#book-interface.is-open .left-door {
    transform: rotateY(-110deg) scale(1.1);
}

#book-interface.is-open .right-door {
    transform: rotateY(110deg) scale(1.1);
}

#book-interface.is-open .book-seal-container {
    opacity: 0;
    transform: scale(2);
    pointer-events: none;
}

#book-interface.is-closed-completely {
    visibility: hidden;
    pointer-events: none;
}

.book-seal-container {
    position: relative;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-seal {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #fcec9a, #d4af37, #996515, #4a3300);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.7),
        inset 0 0 25px rgba(255,255,255,0.5),
        inset 0 0 10px rgba(0,0,0,0.8);
    text-align: center;
    padding: 10px;
    position: relative;
    animation: pulseSeal 2s infinite alternate;
}

.book-seal::before {
    content: '';
    position: absolute;
    width: 88%;
    height: 88%;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.7);
    pointer-events: none;
}

.book-seal::after {
    content: '';
    position: absolute;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    pointer-events: none;
}

@keyframes pulseSeal {
    0% { transform: scale(1); box-shadow: 0 10px 30px rgba(0,0,0,0.7), inset 0 0 25px rgba(255,255,255,0.5); }
    100% { transform: scale(1.05); box-shadow: 0 10px 40px rgba(218, 177, 98, 0.8), inset 0 0 35px rgba(255,255,255,0.8); }
}

.seal-text-top {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #3b2800;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
    margin-bottom: 5px;
    z-index: 1;
}

.seal-text-bottom {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4a3600;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 1;
}

.click-indicator {
    margin-top: 30px;
    color: rgba(255,255,255,1);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: bounceText 2s infinite;
    text-shadow: 0 4px 10px rgba(0,0,0,0.9);
}

@keyframes bounceText {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.book-beam {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100vh;
    background: white;
    box-shadow: 0 0 50px 20px white, 0 0 150px 50px rgba(218,177,98,0.9);
    opacity: 0;
    z-index: 9998;
    pointer-events: none;
    transition: opacity 0.3s ease, width 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

#book-interface.is-open .book-beam {
    opacity: 1;
    width: 200vw;
    animation: fadeOutBeam 1.5s forwards 0.3s;
}

@keyframes fadeOutBeam {
    to {
        opacity: 0;
    }
}

/* Butterfly Swirl Effect */
.butterfly-burst {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    z-index: 10000;
    pointer-events: none;
}

.burst-butterfly-container {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    animation: swirlOut 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.burst-butterfly {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 30px;
    height: 30px;
    background-image: url('butterfly.svg');
    background-size: contain;
    background-repeat: no-repeat;
    animation: fastFlap 0.15s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px rgba(244, 207, 223, 1)) drop-shadow(0 0 20px #fff);
}

@keyframes swirlOut {
    0% {
        opacity: 0;
        transform: rotate(var(--start-angle)) translateX(0) scale(0);
    }
    15% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(var(--end-angle)) translateX(var(--dist)) scale(var(--scale-end));
    }
}

@keyframes fastFlap {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0.1); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 1s ease 2s;
    z-index: 2;
}

body.book-opened .scroll-indicator {
    opacity: 1;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    animation: arrowBounce 2s infinite;
}

@keyframes arrowBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(-10px) rotate(45deg); }
    60% { transform: translateY(-5px) rotate(45deg); }
}

/* Form refinement */
.form-group select:disabled {
    background-color: #f9f9f9;
    color: #ccc;
    cursor: not-allowed;
}
