/* --- CSS Variables / Color Palette --- */
:root {
    --navy: #1f3750;
    /* Deep navy blue from the floral elements */
    --navy-light: #2c4a6b;
    --gold: #d4af37;
    /* Gold from the geometric frame */
    --gold-light: #e6c86a;
    --cream: #f4efeb;
    /* Cream from the background */
    --white: #ffffff;
    --sage: #8f9e8b;
    /* Subtle green from the leaves */
    --text-dark: #2d333b;
    --text-light: #6a6a6a;

    /* Typography */
    --font-names: 'Great Vibes', cursive;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- Reset & Global --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: var(--navy);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gold);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

.section {
    padding: 100px 20px;
}

.bg-light {
    background-color: var(--cream);
}

.gold-divider {
    width: 60px;
    height: 2px;
    background-color: var(--gold);
    margin: 20px auto 40px;
}

/* --- Navigation --- */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: transparent;
    /* Transparent initial state */
    z-index: 1000;
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 50px;
}

.nav-brand {
    font-family: var(--font-names);
    font-size: 2rem;
    color: var(--navy);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--navy);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Create a subtle radial background gradient and add a pattern to mimic texture */
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(244, 239, 235, 1) 100%);
    position: relative;
    padding-top: 60px;
    /* Offset for navbar */
    overflow: hidden;
}

/* Decorative floral abstract blobs to mimic the image's corners */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.6;
}

.hero::before {
    top: -100px;
    left: -100px;
    background: var(--navy);
}

.hero::after {
    bottom: -100px;
    right: -100px;
    background: var(--sage);
}

.hero-content {
    position: relative;
    z-index: 1;
    /* Create a soft, seamless gradient instead of solid white */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 239, 235, 0.85));
    padding: 70px 50px;
    /* Remove hard borders */
    border: none;
    /* Soften the edges with a border-radius rather than a sharp clip-path */
    border-radius: 20px;
    clip-path: none;
    text-align: center;
    /* Enhance the shadow for a floating, sleek effect */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    max-width: 650px;
    width: 90%;
}

/* Inner gold border effect */
.floral-frame {
    position: relative;
}

.floral-frame::before {
    content: '';
    position: absolute;
    top: -30px;
    bottom: -30px;
    left: -20px;
    right: -20px;
    /* Use a very subtle, soft border instead of a hard one */
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Soft Gold */
    border-radius: 15px;
    clip-path: none;
    pointer-events: none;
    opacity: 0.8;
}

.pre-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.subtitle {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.names {
    font-family: var(--font-names);
    font-size: 5rem;
    color: var(--navy);
    line-height: 1.2;
    margin: 10px 0;
}

.ampersand {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-style: italic;
    color: var(--gold);
    vertical-align: middle;
}

.date {
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 6px;
    font-size: 1.2rem;
    margin: 20px 0;
    color: var(--text-dark);
}

.location-text {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--navy-light);
    margin-bottom: 30px;
}

.post-title {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.scroll-indicator:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(3px);
}

.scroll-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--navy);
    font-family: var(--font-body);
    font-weight: 500;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background-color: rgba(212, 175, 55, 0.3);
    /* Base line in faded gold */
    position: relative;
    overflow: hidden;
}

.scroll-line::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--navy);
    /* Moving navy line */
    animation: scrollDrop 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollDrop {
    0% {
        top: -100%;
    }

    50% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

/* --- Sections Common --- */
.section-title {
    font-size: 2.5rem;
    color: var(--navy);
    letter-spacing: 2px;
}

.section-text {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-light);
}

/* --- Our Story Section & Photos --- */
.story-section {
    position: relative;
    overflow: hidden;
    /* Ensure photos don't bleed out of the section completely */
    padding: 120px 20px;
}

.story-content-wrapper {
    position: relative;
    max-width: 900px;
    margin: 40px auto 0;
    min-height: 500px;
    /* Give enough height for the photos to scatter */
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-text-box {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.3);
    /* highly transparent white */
    padding: 50px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* For Safari */
    max-width: 600px;
    pointer-events: none;
    /* Allows mouse to hover photos right through the text */
    user-select: none;
    /* Makes text unhighlightable */
}

.scattered-photos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Removed z-index: 1 so child photos can pop out over the text box matching the root stacking context */
}

.scatter-photo {
    position: absolute;
    width: 250px;
    height: auto;
    background-color: #ffffff;
    padding: 15px 15px 35px 15px;
    box-shadow: 2px 5px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

.scatter-photo:hover,
.scatter-photo.mobile-active {
    transform: scale(1.3) rotate(0deg) !important;
    z-index: 50 !important;
    box-shadow: 5px 25px 50px rgba(0, 0, 0, 0.4);
    opacity: 1 !important;
}

/* Positioning the individual photos */
.photo-1 {
    top: -20px;
    left: -80px;
    transform: rotate(-12deg);
}

.photo-2 {
    bottom: -30px;
    left: 10px;
    transform: rotate(8deg);
}

.photo-3 {
    top: 30px;
    right: -60px;
    transform: rotate(15deg);
}

.photo-4 {
    bottom: 20px;
    right: 10px;
    transform: rotate(-6deg);
}

.photo-5 {
    top: -80px;
    right: 25%;
    transform: rotate(90deg);
    width: 230px;
}

.photo-6 {
    top: 120px;
    left: -100px;
    transform: rotate(5deg);
    width: 220px;
}

.photo-7 {
    bottom: -60px;
    right: -20px;
    transform: rotate(12deg);
    width: 200px;
}

.photo-8 {
    bottom: 100px;
    left: -50px;
    transform: rotate(-8deg);
    width: 180px;
}

.photo-9 {
    top: 100px;
    right: -60px;
    transform: rotate(-10deg);
    width: 190px;
}

/* --- Details Section --- */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.detail-card {
    padding: 40px;
    background: var(--white);
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--gold-light);
}

.detail-card h3 {
    font-size: 1.8rem;
    color: var(--navy);
    margin-bottom: 15px;
}

.detail-card .time {
    font-weight: 600;
    color: var(--gold);
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.dress-code {
    margin-top: 50px;
    font-size: 1.1rem;
    font-style: italic;
    font-family: var(--font-heading);
}

/* --- Location Section --- */
.map-container {
    width: 100%;
    height: 400px;
    background-color: #e5e5e5;
    border: 2px solid var(--white);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* --- RSVP Section --- */
.rsvp-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--white);
    padding: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    background-color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.btn {
    background-color: var(--navy);
    color: var(--white);
    padding: 15px 30px;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn:hover {
    background-color: var(--gold);
}

/* --- Footer --- */
.footer {
    background-color: var(--navy);
    color: var(--white);
    text-align: center;
    padding: 60px 20px;
}

.footer .names-small {
    font-family: var(--font-names);
    font-size: 3rem;
    margin: 20px 0 10px;
    color: var(--gold);
}

.footer .date {
    color: var(--cream);
    margin: 0;
    font-size: 1rem;
}

/* --- Registry & Modal --- */
.registry-btn {
    margin-top: 30px;
    background-color: var(--white);
    color: var(--navy);
    border: 1px solid var(--navy);
}

.registry-btn:hover {
    background-color: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(31, 55, 80, 0.8);
    /* Navy overlay */
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    padding: 50px;
    border: 1px solid var(--gold);
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: var(--text-light);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--navy);
    text-decoration: none;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--navy);
    margin-bottom: 20px;
}

.modal-text {
    color: var(--text-dark);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.bank-details {
    background-color: var(--cream);
    padding: 25px;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 30px;
    border: 1px dashed var(--gold);
}

.bank-details p {
    margin-bottom: 10px;
    font-family: var(--font-body);
}

.bank-details p:last-child {
    margin-bottom: 0;
}

.bank-details strong {
    color: var(--navy);
    display: inline-block;
    width: 150px;
}

.modal-note {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #navbar {
        padding: 20px;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        gap: 0;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 16px 0;
    }

    .names {
        font-size: 3.5rem;
    }

    .ampersand {
        font-size: 2rem;
    }

    .hero-content {
        padding: 40px 20px;
        clip-path: none;
        margin-bottom: 40px;
    }

    .scroll-indicator {
        bottom: 15px;
        transform: translateX(-50%) scale(0.85);
    }

    .scroll-indicator:hover {
        transform: translateX(-50%) scale(0.85) translateY(3px);
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 70px 20px;
    }

    .scattered-photos {
        pointer-events: none;
        /* Make entirely unclickable until we bring individual photos forward */
    }

    .scatter-photo {
        opacity: 0.2;
        /* Fade them out so text is readable */
        pointer-events: auto;
        /* Ensure individual images remain touchable */
    }

    .photo-1,
    .photo-6,
    .photo-8 {
        left: -80px;
    }

    .photo-2,
    .photo-3 {
        right: -60px;
    }

    .photo-4,
    .photo-5,
    .photo-7,
    .photo-9 {
        right: -80px;
    }
}