/* --- Base Styles & Overrides --- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    color: var(--dark-green);
    -webkit-font-smoothing: antialiased;
    touch-action: pan-y;
}

body.noscroll {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* --- CSS Variables --- */
:root {
    --sage: #9DC183;
    --olive: #556B2F;
    --cream: #F9F9F5;
    --dark-green: #2F3E28;
    --gold: #D4AF37;
}

/* --- Typography --- */
h1, h2, h3, .serif {
    font-family: 'Cormorant Garamond', serif;
}

.script-font {
    font-family: 'Great Vibes', cursive;
}

/* --- Container Breakout --- */
.ghl-breakout {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: 100vw !important;
    overflow-x: hidden;
}

/* --- Curtain Animation --- */
#curtain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    pointer-events: auto;
    transition: opacity 1.5s ease;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.curtain-panel {
    background-color: var(--dark-green);
    width: 50%;
    height: 100%;
    position: relative;
    transition: transform 2s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    will-change: transform;
}

.curtain-img {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200%;
    background-image: url('../images/splash.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.curtain-panel.left .curtain-img {
    left: 0;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.curtain-panel.right .curtain-img {
    right: 0;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.curtain-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(47, 62, 40, 0.6);
    z-index: 1;
}

.curtain-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 61;
    text-align: center;
    color: var(--cream);
    width: 100%;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 0 20px;
    box-sizing: border-box;
}

#curtain-overlay.open .curtain-panel.left {
    transform: translateX(-100%);
}

#curtain-overlay.open .curtain-panel.right {
    transform: translateX(100%);
}

#curtain-overlay.open .curtain-content {
    opacity: 0;
}

#curtain-overlay.hidden {
    display: none;
}

/* --- Petals --- */
#petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000;
    overflow: hidden;
}

.petal {
    position: absolute;
    top: -10%;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 100% 0 100% 0;
    opacity: 0.6;
    animation: fall linear infinite;
    will-change: transform;
}

@keyframes fall {
    0% { 
        transform: translate(0, 0) rotate(0deg); 
        opacity: 0; 
    }
    10% { 
        opacity: 0.8; 
    }
    90% { 
        opacity: 0.8; 
    }
    100% { 
        transform: translate(20px, 110vh) rotate(360deg); 
        opacity: 0; 
    }
}

/* --- Navigation --- */
@keyframes slideDown {
    from { 
        transform: translateY(-100%); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

nav {
    transition: all 0.4s ease;
    animation: slideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.6s;
    opacity: 0;
    color: #F9F9F5;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    z-index: 9998;
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    background-image: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
    padding-bottom: 1rem;
    color: var(--dark-green);
}

nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: #D4AF37;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* --- Gallery --- */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* --- Fade In Sections --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Maps --- */
.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

/* --- Floating Music Player --- */
.floating-music {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9990;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.floating-music.scrolled-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.music-disc {
    width: 50px;
    height: 50px;
    background: var(--olive);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    animation: spin 4s linear infinite;
    animation-play-state: paused;
    position: relative;
    z-index: 20;
    -webkit-tap-highlight-color: transparent;
}

.music-disc.playing {
    animation-play-state: running;
}

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

.spotify-embed-container {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 300px;
    max-width: 80vw;
    height: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.floating-music.active .spotify-embed-container {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.music-tooltip {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    color: var(--dark-green);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 15;
    font-weight: 500;
}

.music-tooltip.tooltip-visible {
    opacity: 1;
}

.music-tooltip::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: white;
}

/* --- Mobile Menu --- */
#mobile-menu {
    z-index: 10000;
}

/* --- RSVP Modal --- */
#rsvp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#rsvp-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.rsvp-content {
    background: var(--cream);
    width: 90%;
    max-width: 640px;
    height: 85vh;
    border-radius: 12px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#rsvp-modal.open .rsvp-content {
    transform: translateY(0);
}
