/* --- Base & Mobile First Setup --- */
:root {
    --text-main: #333;
    --text-light: #666;
    --bg-color: #fdfcfb;
    --dark-section: #4a5d73;
    --gold: #c5a880;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #333;
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Forces the site to look like a mobile app even on desktop */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    position: relative;
}

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

/* --- Hero Section with Crossfade --- */
.hero {
    /* Use dynamic viewport height (dvh) so it adapts to browser UI bars */
    height: 100dvh;

    /* Fallback for older browsers */
    min-height: 100vh;

    /* This stops the padding from adding extra height to the 100vh */
    box-sizing: border-box;

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;

    /* Increased slightly to push the text up a bit more into view */
    padding-bottom: 15vh;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
}

.hero-img-1 {
    z-index: 1;
    animation: heroFade 8s ease-in-out infinite;
}

.hero-img-2 {
    z-index: 0;
}

@keyframes heroFade {

    0%,
    40% {
        opacity: 1;
    }

    50%,
    90% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 4;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 4.5rem;
    margin: 0;
    text-shadow: 1px 1px 15px rgba(0, 0, 0, 0.4);
    letter-spacing: 4px;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
}

.scroll-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    letter-spacing: 3px;
    z-index: 4;
    margin-top: 30px;
    text-transform: uppercase;
    position: relative;
}

.scroll-hint::after {
    content: '';
    display: block;
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.5);
    margin: 10px auto 0;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(0.8);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* --- Falling Petals --- */
.petal {
    position: absolute;
    top: 0;
    width: var(--size, 32px);
    height: auto;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    animation: petalDrift var(--dur, 10s) var(--delay, 0s) ease-in-out infinite;
}

@keyframes petalDrift {
    0%   { transform: translateY(-5%)   translateX(0)          rotate(0deg);   opacity: 0; }
    8%   { opacity: 0.85; }
    25%  { transform: translateY(25vh)  translateX(var(--sx))  rotate(50deg); }
    50%  { transform: translateY(52vh)  translateX(var(--sm))  rotate(130deg); }
    75%  { transform: translateY(76vh)  translateX(var(--se))  rotate(210deg); }
    92%  { opacity: 0.5; }
    100% { transform: translateY(108vh) translateX(var(--sx))  rotate(300deg); opacity: 0; }
}

/* --- Global Section Styling --- */
.section {
    padding: 60px 30px;
    text-align: center;
}

.section h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.section p {
    font-size: 0.9rem;
    line-height: 1.9;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section images */
.section-photo {
    width: 100%;
    border-radius: 6px;
    margin: 25px 0;
    object-fit: cover;
    max-height: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* --- Floral Divider --- */
.divider {
    width: 60px;
    height: 1px;
    background: var(--gold);
    margin: 20px auto;
    position: relative;
}

.divider::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    color: var(--gold);
    background: var(--bg-color);
    padding: 0 8px;
}

/* --- Music Player --- */
.music-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border: 1px solid var(--text-main);
    border-radius: 50%;
    background: var(--bg-main, #fff);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.music-player:hover {
    background-color: #eee;
    transform: scale(1.05);
}

/* --- Countdown Timer --- */
.countdown {
    display: none; /* revealed after scratch */
    justify-content: space-between;
    margin: 30px 0;
    padding: 25px 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.time-box {
    text-align: center;
    width: 22%;
}

.time-box span {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}

.time-box p {
    font-size: 0.6rem;
    margin: 5px 0 0 0;
    letter-spacing: 1px;
}

/* --- Date Display --- */
.wedding-date {
    font-size: 2.5rem;
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    letter-spacing: 2px;
}

/* --- Scratch Reveal --- */
.scratch-wrapper {
    position: relative;
    display: block;
    padding: 15px 24px;
    margin: 10px 0;
    border: 1px solid rgba(197, 168, 128, 0.35);
    border-radius: 4px;
}

.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
    transition: opacity 0.7s ease;
}

.scratch-canvas.done {
    opacity: 0;
    pointer-events: none;
}

/* --- Location (Dark Section) --- */
.location-section {
    background-color: var(--dark-section);
    color: white;
}

.location-section p {
    color: rgba(255, 255, 255, 0.8);
}

.location-section .divider::before {
    background: var(--dark-section);
}

.venue-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    text-transform: none;
    color: white;
    font-style: italic;
}

/* --- Start Time Section --- */
.start-time {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.start-time p {
    font-size: 0.8rem;
}

.start-time .time-display {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
    margin: 10px 0;
    display: block;
}

/* --- Button --- */
.btn {
    display: inline-block;
    margin-top: 25px;
    padding: 14px 28px;
    border: 1px solid white;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.btn:hover {
    background-color: white;
    color: var(--dark-section);
}

.btn + .btn {
    margin-left: 8px;
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.85);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Schedule / Timeline --- */
.schedule-list {
    list-style: none;
    padding: 0;
    margin: 30px auto 0;
    max-width: 320px;
    text-align: left;
    position: relative;
}

.schedule-list::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    border-left: 1px dashed var(--gold);
    opacity: 0.6;
}

.schedule-item {
    position: relative;
    padding: 0 0 22px 28px;
}

.schedule-item:last-child {
    padding-bottom: 0;
}

.schedule-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--gold);
}

.schedule-time {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 4px;
}

.schedule-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    margin: 0 0 4px;
    color: var(--text-main);
    letter-spacing: 0;
    text-transform: none;
}

.schedule-desc {
    font-size: 0.7rem;
    color: var(--text-light);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.55;
}

/* --- RSVP Form --- */
#rsvp-form {
    text-align: left;
    margin-top: 30px;
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin-bottom: 10px;
}

#rsvp-form input[type="text"],
#rsvp-form textarea,
#rsvp-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    background: white;
    color: var(--text-main);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}

#rsvp-form input[type="text"]:focus,
#rsvp-form textarea:focus,
#rsvp-form select:focus {
    outline: none;
    border-color: var(--gold);
}

#rsvp-form textarea {
    resize: vertical;
    min-height: 80px;
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
}

.radio-option:has(input:checked) {
    border-color: var(--gold);
    color: var(--text-main);
    background: rgba(197, 168, 128, 0.08);
}

.radio-option input[type="radio"] {
    display: none;
}

#companions-group {
    display: none;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 16px;
    background: none;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--text-main);
    color: white;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#rsvp-success {
    text-align: center;
}

#rsvp-success p {
    text-transform: none;
    letter-spacing: 0;
}

/* --- Footer Logo --- */
.footer-logo {
    text-align: center;
    margin-bottom: 16px;
}

/* --- Footer Icons --- */
.footer-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0;
}

.icon-circle {
    width: 45px;
    height: 45px;
    border: 1px solid var(--text-main);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.icon-circle:hover {
    background: var(--text-main);
    color: white;
}

/* --- AOS Custom Overrides --- */
[data-aos] {
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 3px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #888;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}

.lang-btn.active {
    background: #333;
    color: white;
}

[data-aos="fade-up"] {
    transform: translate3d(0, 30px, 0) !important;
}

[data-aos="fade-up"].aos-animate {
    transform: translate3d(0, 0, 0) !important;
}

/* --- Signature --- */
.signature {
    margin-top: 30px;
    font-size: 0.95rem;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.signature .cursive {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.8rem;
    color: var(--text-main);
    display: block;
    margin-top: 10px;
    text-transform: none;
}

/* --- Preloader / Envelope --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #4a5d73;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.env-wrap {
    perspective: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Envelope Slider --- */
.env-slider {
    margin-top: 28px;
    width: 260px;
}

.env-slider-track {
    position: relative;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.env-slider-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.env-slider-thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5d73;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: grab;
    touch-action: none;
    will-change: transform;
}

.env-slider-thumb:active {
    cursor: grabbing;
}

.env {
    position: relative;
    width: 260px;
    height: 165px;
}

.env-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #3a5068;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* decorative bottom-fold crease */
.env-body::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: rgba(0, 0, 0, 0.07);
    clip-path: polygon(0 100%, 100% 100%, 50% 0);
}

/* left & right fold crease */
.env-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(0,0,0,0.06) 49.5%, transparent 50%),
        linear-gradient(225deg, rgba(0,0,0,0.06) 49.5%, transparent 50%);
}

/* invitation card — starts hidden inside, slides up when JS adds .rising */
.env-card {
    position: absolute;
    bottom: -100%;
    left: 10%;
    width: 80%;
    height: 90%;
    background: #f7f4ef;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.env-card.rising {
    animation: cardRise 0.65s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

.env-card-names {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    letter-spacing: 4px;
    color: #4a5d73;
}

@keyframes cardRise {
    to { bottom: -15%; }
}

/* flap — triangle pointing down, rotated open by JS drag */
.env-flap-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 83px;
    transform-origin: top center;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 2;
}

.env-flap {
    width: 100%;
    height: 100%;
    background: #4a6680;
    clip-path: polygon(0 0, 100% 0, 50% 88%);
}

.env-seal {
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #c5a880;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 0.55rem;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* --- Menu Section --- */
.menu-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.menu-card {
    border: 1px solid rgba(197, 168, 128, 0.3);
    border-radius: 4px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.menu-card-img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.menu-card-body {
    padding: 14px 16px;
    border-top: 2px solid var(--gold);
}

.menu-card-name {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.55;
    margin: 0;
    color: var(--text-main);
    text-transform: none;
    letter-spacing: 0;
}

/* --- Performers Section --- */
.performer-list {
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.performer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 14px 18px;
    border: 1px solid rgba(197, 168, 128, 0.4);
    border-radius: 4px;
    background: white;
}

.performer-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid var(--gold);
    margin-bottom: 12px;
}

.performer-time {
    display: block;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 6px;
}

.performer-name {
    font-size: 1.1rem;
    margin: 0 0 4px;
    color: var(--text-main);
}

.performer-role {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}
/* Guest hydration: event sections hidden by default; JS reveals for permitted guests */
[data-event] { display: none; }

/* Event sections get a subtle warm border to stand out */
[data-event] .divider { border-color: var(--gold); }

/* Table badge — shown near the venue section for personalized guests */
.table-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem auto;
    max-width: 220px;
    background: rgba(212, 175, 122, 0.08);
    border: 1px solid rgba(212, 175, 122, 0.4);
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
}
.table-badge-icon { font-size: 1.6rem; line-height: 1; }
.table-badge-text { text-align: center; }
.table-badge-label {
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}
.table-badge-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    margin: 0;
    line-height: 1.2;
}

.event-eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    margin: 0.25rem 0 1rem;
}

.event-meta {
    margin: 1.25rem auto 0;
    max-width: 300px;
    text-align: left;
}
.event-meta-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    border-bottom: 1px solid rgba(212,175,122,0.15);
}
.event-meta-row:last-child { border-bottom: none; }
.event-meta-icon { font-size: 1rem; flex-shrink: 0; }
