:root {
    --primary: #3d4f25; 
    --bg-color: #fdfcf8;
    --pico-font-family: 'Cormorant Garamond', serif;
}
html, body {
    margin: 0; padding: 0; height: 100%; width: 100%;
    background-color: var(--bg-color); color: #333; overflow: hidden; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}
.global-palette-bar {
    position: fixed; top: 0; left: 0; width: 100%; height: 5px;
    display: flex; z-index: 9999;
}
.global-palette-bar div {
    flex: 1; height: 100%;
}
.scroll-container {
    height: 100vh; width: 100vw; overflow-y: scroll;
    scroll-snap-type: y mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
section {
    height: 100vh; width: 100%; scroll-snap-align: start; scroll-snap-stop: always;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; position: relative; box-sizing: border-box;
}
.content-box { width: 100%; max-width: 900px; text-align: center; }
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg-color); z-index: 3000; display: flex; 
    align-items: center; justify-content: center; text-transform: uppercase; 
    letter-spacing: 3px; color: var(--primary);
}
#password-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); z-index: 2000; display: flex; align-items: center; justify-content: center; transition: opacity 0.8s ease;
}
.pw-card { max-width: 400px; width: 90%; padding: 3rem; text-align: center; border: 1px solid #e0ddd5; background: white; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
#pw-input { text-align: center; border-radius: 0; border: none; border-bottom: 1px solid #ccc; font-size: 16px !important; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s ease-out, transform 1s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; } 
.delay-2 { transition-delay: 0.4s; }
h1, h2, h3 { color: var(--primary); font-weight: 300; text-transform: uppercase; letter-spacing: 0.2rem; margin-bottom: 0.5rem; }
.names { font-size: clamp(3rem, 10vw, 5rem); margin-bottom: 0; line-height: 1; }
.lowercase-invite { text-transform: lowercase; font-style: italic; letter-spacing: 0.1rem; color: #646464; font-size: clamp(1rem, 3vw, 1.2rem); }
.quote-text { font-size: clamp(1.8rem, 5vw, 2.5rem); font-style: italic; color: #333; line-height: 1.3; }
.verse-text { font-size: 1rem; color: #333; margin-top: 1rem; letter-spacing: 2px; text-transform: uppercase; }
.ampersand { font-size: clamp(3rem, 8vw, 5rem); color: #333; font-style: italic; }
.paint-image {
    -webkit-mask-image: linear-gradient(105deg, rgba(0,0,0,1) 40%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 80%);
    mask-image: linear-gradient(105deg, rgba(0,0,0,1) 40%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 80%);
    -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
    -webkit-mask-position: 100% 0; mask-position: 100% 0;
    opacity: 0; transform: scale(0.97); filter: grayscale(100%) sepia(30%) blur(4px); 
}
.reveal.active .paint-image { animation: brushStroke 2.8s cubic-bezier(0.25, 1, 0.5, 1) forwards; animation-delay: 0.6s; }
@keyframes brushStroke {
    0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; filter: grayscale(100%) sepia(30%) blur(4px); opacity: 0.3; transform: scale(0.97); }
    100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; filter: grayscale(0%) sepia(0%) blur(0px); opacity: 1; transform: scale(1); }
}
.parallax-bg { background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; }
.quote-section { position: relative; }
.quote-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.5; mix-blend-mode: multiply; z-index: 1; pointer-events: none; }
.quote-section .content-box { position: relative; z-index: 2; }
.gallery-section { position: relative; overflow: hidden; }
.gallery-grid-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: grid; z-index: 1; filter: brightness(0.6);
}
.gallery-cell {
    background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover;
    transition: background-image 1.5s ease-in-out;
}
.btn-white { border-color: white; color: white; }
.btn-white:hover { background: white; color: var(--primary); }
.couple-grid { display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 5vw, 4rem); margin-top: 2rem; }
.portrait-wrapper { text-align: center; }
.portrait {
    position: relative; width: clamp(150px, 35vw, 250px); height: auto; aspect-ratio: 2 / 3;
    background: #eee; border: 1px solid #ccc; border-radius: 150px 150px 0 0; 
    margin: 0 auto 1rem; overflow: hidden; filter: grayscale(100%); transition: filter 0.5s ease;
}
.portrait img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.img-hover { opacity: 0; transition: opacity 0.5s ease; }
.portrait:hover { filter: grayscale(0%); }
.portrait:hover .img-hover { opacity: 1; }
@media (hover: none) {
    .portrait { animation: mobileColorSwap 6s infinite alternate ease-in-out; }
    .img-hover { animation: mobileImageSwap 6s infinite alternate ease-in-out; }
    #groom-portrait-container, #groom-portrait-container .img-hover { animation-delay: 3s; }
}
@keyframes mobileImageSwap { 0%, 35% { opacity: 0; } 65%, 100% { opacity: 1; } }
@keyframes mobileColorSwap { 0%, 35% { filter: grayscale(100%); } 65%, 100% { filter: grayscale(0%); } }
.portrait-name { font-size: 1.5rem; color: var(--primary); font-weight: bold; }
.portrait-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 3px; color: #888; }
.event-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 1.5rem 0; margin: 1.5rem 0; }
.event-col h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: #888; margin-bottom: 0.5rem; }
.event-col p { font-size: clamp(0.9rem, 2vw, 1.2rem); color: var(--primary); font-weight: bold; margin: 0; line-height: 1.4; }
.map-container { width: 100%; height: clamp(150px, 20vh, 250px); border: 1px solid #e0ddd5; margin-bottom: 1.5rem; background: #eee; }
.map-container iframe { width: 100%; height: 100%; border: none; filter: grayscale(100%) opacity(0.6) sepia(10%); transition: filter 0.3s ease; }
.map-container iframe:hover { filter: grayscale(0%) opacity(1) sepia(0%); }
.final-section { position: relative; }
.final-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; filter: brightness(0.75); }
.final-section .content-box { position: relative; z-index: 2; }
.contact-card { background: var(--bg-color); padding: 2.5rem; border-radius: 12px; box-shadow: 0 15px 40px rgba(0,0,0,0.25); max-width: 400px; margin: 0 auto; }
.palette-container { margin-bottom: .5rem; padding: 1.5rem 0; border-top: 1px dashed #eee; border-bottom: 1px dashed #eee; }
.color-swatches { display: flex; justify-content: center; gap: 12px; }
.swatch { border-bottom: none !important; cursor: help; width: 32px; height: 32px; border-radius: 50%; transition: transform 0.3s cubic-bezier(0.10, 1, 0.5, 1), box-shadow 0.3s ease; border: 1px solid rgba(0,0,0,0.05); }
.swatch:hover { box-shadow: 0 8px 15px rgba(0,0,0,0.15); }
.floating-rsvp { position: fixed; bottom: 30px; right: 30px; background: var(--primary); color: white !important; padding: 1rem 2.5rem; text-decoration: none; text-transform: uppercase; letter-spacing: 3px; font-size: 0.8rem; border-radius: 50px; box-shadow: 0 4px 15px rgba(61, 79, 37, 0.3); transition: all 0.3s ease; z-index: 1000; display: none; opacity: 0; }
.floating-rsvp:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(61, 79, 37, 0.4); background: #2a3819; }
#floating-countdown { position: fixed; top: 20px; right: 20px; z-index: 1000; display: none; flex-direction: column; gap: 4px; text-align: center; color: #333; transition: opacity 0.5s ease, transform 0.5s ease; opacity: 0; transform: translateY(-20px); pointer-events: none; }
#floating-countdown span { font-size: 0.85rem; font-weight: bold; line-height: 1; font-style: italic; color: #333; }
#floating-countdown small { font-size: 0.45rem; text-transform: uppercase; letter-spacing: 1px; color: #333; display: block; font-style: italic; }
.btn-minimal { background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: 0.8rem 3rem; text-decoration: none; text-transform: uppercase; letter-spacing: 4px; transition: 0.4s; display: inline-block; cursor: pointer; text-align: center; }
.btn-minimal:hover { background: var(--primary); color: white; }
.btn-preview { margin-top: 1rem; width: 100%; font-size: 0.8rem; color: #888; background: transparent; border: none; cursor: pointer; text-decoration: underline; font-family: var(--pico-font-family); letter-spacing: 1px; }
.btn-preview:hover { color: var(--primary); }
.dev-credit { font-size: 0.4rem; color: #aaa; margin-top: 1.5rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0; }
.countdown-row { display: flex; justify-content: center; gap: clamp(1rem, 4vw, 3rem); margin-top: 2rem; }
.number { font-size: clamp(2rem, 7vw, 4rem); color: var(--primary); font-weight: bold; line-height: 1; }
.label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: #888; margin-top: 0.5rem; }
.scroll-hint { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; letter-spacing: 3px; color: #ccc; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.5; transform: translate(-50%, 0); } 50% { opacity: 1; transform: translate(-50%, 5px); } 100% { opacity: 0.5; transform: translate(-50%, 0); } }
.contact-text { font-size: 1rem; color: #646464; margin-bottom: 0.5rem; text-decoration: none; }
.contact-text:hover { color: var(--primary); }
.clickable-hero { cursor: pointer; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); }
.clickable-hero:hover { transform: scale(1.02); }
[data-tooltip]::before { background: var(--primary); color: white; font-family: var(--pico-font-family); font-style: italic; letter-spacing: 1px; font-size: 0.9rem; padding: 0.5rem 1rem; }
.modal-card { max-width: 900px !important; width: 95%; background: var(--bg-color); border: 1px solid #e0ddd5; padding: 2.5rem !important; box-shadow: 0 20px 50px rgba(0,0,0,0.15); border-radius: 12px; }
.modal-card header { background: transparent; border-bottom: 1px solid #eee; padding-bottom: 1rem; margin-bottom: 2rem; }
.story-container { display: block; }
.story-image-wrapper { max-width: 45%; margin: 0 auto 2.5rem auto; }
.story-image-wrapper img { width: 100%; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); object-fit: cover; aspect-ratio: 3/4; }
.story-content p { font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.8; color: #555; margin-bottom: 1.2rem; text-align: justify; }
.story-content p:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
    .floating-rsvp { bottom: 20px; right: 20px; width: auto; transform: none; padding: 1rem 1.5rem; }
    .floating-rsvp:hover { transform: translateY(-3px); }
    #floating-countdown { top: 15px; right: 15px; }
    #floating-countdown span { font-size: 0.75rem; }
    #floating-countdown small { font-size: 0.4rem; }
    .parallax-bg { background-attachment: scroll; background-position-x: 75%; } 
    .story-image-wrapper { max-width: 80%; margin: 0 auto 1.5rem auto; }
    .modal-card { padding: 1.5rem !important; }
}
@media (max-width: 500px) {
    .event-grid { grid-template-columns: 1fr; gap: 1.5rem; border-top: none; border-bottom: none; margin-bottom: .5rem; padding-bottom: .5rem; }
    .event-col { border-left: none !important; border-right: none !important; border-bottom: 1px solid #eee; padding-bottom: 1rem; }
    .event-col:last-child { border-bottom: none; }
}