/* ============================================
   ROMANTIC TEMPLATE — FLORAL WEDDING INVITATION
   Color Palette: Dusty Rose · Sage · Cream · Gold
   ============================================ */

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

@font-face {
    font-family: 'Mozart';
    src: url('Mozart Regular.otf') format('opentype');
    font-display: block;
}

:root {
    --rose: #A12322;
    --rose-deep: #A12322;
    --rose-light: #F0DADA;
    --sage: #7C8E76;
    --sage-light: #D4DDD1;
    --cream: #FAF6F1;
    --cream-dark: #EDE7DF;
    --gold: #BFA06A;
    --text-dark: #2E2926;
    --text-muted: #7A6E68;

    --font-serif: 'Cormorant Garamond', serif;
    --font-script: 'Mozart', cursive;
    --font-sans: 'Inter', sans-serif;
}

/* ─── Reset ─────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: clip;
}

body {
    background: var(--cream);
    color: var(--text-dark);
    font-family: var(--font-serif);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@media (min-width: 501px) {
    body {
        max-width: 600px;
        margin: 0 auto;
        box-shadow: 0 0 100px rgba(0, 0, 0, 0.1);
        position: relative;
        background: #fff;
    }

    html {
        background: #f5f5f5;
    }
}

::-webkit-scrollbar {
    display: none;
}

/* ─── Loader ─────────────────────────────── */
.loader {
    position: fixed;
    inset: 0;
    background: var(--cream);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    font-family: var(--font-script);
    font-size: 2.8rem;
    color: var(--rose-deep);
    letter-spacing: 0.02em;
}

.loader-line {
    width: 60px;
    height: 1px;
    background: var(--rose);
    margin: 0 auto;
    animation: grow 1.5s ease-in-out infinite;
}

@keyframes grow {

    0%,
    100% {
        transform: scaleX(0.2);
        opacity: 0.3;
    }

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

/* ─── Music Button ───────────────────────── */
.music-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: none; /* Hidden by default if moving to modal-style */
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s;
}

.modal-music-btn {
    position: fixed;
    top: 25px; 
    right: 20px;
    width: 70px; /* Larger */
    height: 70px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s;
    animation: fade-down-center 1.5s ease 1.5s forwards;
    opacity: 0;
}

@media (min-width: 501px) {
    .modal-music-btn {
        right: calc(50% - 300px + 20px);
    }
}

.modal-music-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-music-btn:hover {
    transform: scale(1.1);
}

.music-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    /* Removed padding to make icon appear larger */
}

.music-btn.playing img {
    animation: spin 12s linear infinite;
}

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

/* ─── Scroll Navigation ────────────────── */
.scroll-navigation {
    position: fixed;
    top: 0;
    left: 1.5rem;
    width: 2px;
    height: 100vh;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.scroll-navigation.active {
    opacity: 1;
}

.scroll-track {
    position: absolute;
    top: 5vh;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--rose-light);
    opacity: 0.3;
}

.scroll-icon {
    position: absolute;
    left: 50%;
    top: 5vh;
    width: 48px;
    height: auto;
    transform: translate(-50%, 0);
    transition: transform 0.1s linear;
}

@media (min-width: 501px) {
    .scroll-navigation {
        left: calc(50% - 300px + 1.5rem);
    }
}

/* ─── Hero ───────────────────────────────── */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--cream);
    z-index: 1;
}

@media (min-width: 501px) {
    .hero {
        min-height: 750px; /* Shorter height for desktop frames */
        height: 750px;
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    opacity: 0;
    animation: bg-reveal 4.5s ease-out 0.5s forwards;
}

@media (min-width: 501px) {
    .hero-bg {
        background-size: cover; /* Fill the frame instead of contain */
        background-position: center center;
    }
}

@media (min-width: 481px) {
    .hero-bg {
        background-size: cover;
        background-position: center center;
    }
}

@keyframes bg-reveal {
    from {
        opacity: 0;
        transform: scale(1.08);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Top floral overlay image */
.hero-floral-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 3;
}

.hero-floral-top img {
    width: 100%;
    display: block;
}

.hero-floral-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 3;
}

.hero-floral-bottom img {
    width: 100%;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.hero-pretitle {
    position: absolute;
    top: 40px; /* Slightly lower than before */
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 0.9rem; /* Larger */
    font-weight: 300;
    /* Standardized to non-bold */
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: var(--rose-deep);
    opacity: 0;
    z-index: 10;
    animation: fade-down-center 1.5s ease 1.5s forwards;
}

.hero-names {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.name-main {
    font-family: var(--font-script);
    font-size: clamp(4rem, 15vw, 5.5rem);
    color: var(--rose-deep);
    font-weight: 300;
    /* Standardized to non-bold */
    line-height: 1.3;
    letter-spacing: 0.05em;
    padding: 0.1em 0.3em; /* Space for swashes */
    opacity: 0;
    animation: slide-left 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards;
}

.name-amp {
    font-family: var(--font-script); /* Match names */
    font-size: 2.5rem; /* Large enough to be visible but smaller than names */
    color: var(--rose-deep); /* Match names */
    letter-spacing: 0;
    font-style: normal;
    opacity: 0;
    animation: fade-up 1s ease 1.8s forwards;
    margin: -1.5rem 0; /* Adjust margin due to script font flourishing */
}

.name-second {
    font-family: var(--font-script);
    font-size: clamp(4rem, 15vw, 5.5rem);
    color: var(--rose-deep);
    font-weight: 300;
    /* Standardized to non-bold */
    line-height: 1.3;
    letter-spacing: 0.05em;
    padding: 0.1em 0.3em; /* Space for swashes */
    opacity: 0;
    animation: slide-right 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards;
}

.hero-date {
    position: absolute;
    bottom: 40px; /* Anchored to bottom with same offset as top */
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 300;
    /* Made non-bold */
    letter-spacing: 0.25em;
    color: var(--rose-deep);
    opacity: 0;
    animation: fade-up 0.8s ease 2.2s forwards;
}

.hero-divider {
    display: none;
}

@keyframes fade-down-center {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-left {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-right {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ─── Reveal helper ──────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Word Reveal Animation ─────────── */
.gossamer-word {
    display: inline-block;
    opacity: 0;
    filter: blur(8px);
    transform: translateY(10px);
    animation: gossamerFadeIn 0.8s ease forwards;
}

@keyframes gossamerFadeIn {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ─── Section defaults ───────────────────── */
.section {
    position: relative;
    z-index: 10;
    /* Stack sections over the sticky hero */
    background: var(--cream);
    /* Ensure opacity to cover hero */
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

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

/* ─── Section title ──────────────────────── */
.script-heading {
    font-family: var(--font-script);
    font-size: clamp(3rem, 10vw, 3.8rem);
    font-weight: 300;
    /* Standardized to non-bold */
    color: var(--rose-deep);
    line-height: 1.3;
    padding: 0.2em 0.5em; /* Generous padding for swashes */
    margin-bottom: 0.1rem;
    display: inline-block;
    width: 100%;
}

.serif-label {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    display: block;
}

.story-section .serif-label {
    color: var(--rose-light);
    /* Better contrast on red */
}

.gold-rule {
    display: none;
}

/* ─── Intro / Invitation text ────────────── */
.invitation-section {
    background: var(--cream);
    /* Neutral background for the inset look */
    padding: 5rem 0;
    /* Changed from 2.5rem */
    min-height: auto;
    /* Removed 100vh */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.invitation-bg-container {
    background: url('2.webp') no-repeat center center;
    background-size: cover;
    width: 90%;
    margin: 0 auto;
    padding: 4rem 1rem;
    /* Reduced from 2rem to allow wider content */
    box-shadow: 0 15px 45px rgba(161, 35, 34, 0.1);
    /* Subtle rose-tinted shadow */
    border-radius: 4px;
    /* Slight rounding for a premium card feel */
}

.invitation-section .container {
    padding-top: 0;
    padding-bottom: 0;
}

.invitation-text {
    position: relative;
    padding: 3rem 1.25rem;
    /* Reduced from 2rem to maximize width */
    background: rgba(250, 246, 241, 0.92);
    /* var(--cream) with slight opacity */
    border: 1px solid rgba(191, 160, 106, 0.3);
    /* Subtle gold border */
    outline: 4px solid rgba(250, 246, 241, 0.5);
    /* Double "frame" effect */
    outline-offset: -12px;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-dark);
    /* Reverted to dark as requested */
    line-height: 1.6;
    max-width: 520px;
    /* Slightly narrower for better proportion */
    margin: 0 auto;
    text-align: center;
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Soft lift */
}

.invitation-text em {
    font-style: italic;
    color: var(--rose-deep);
}

/* ─── Gallery / Photo strip ──────────────── */
.gallery-section {
    background: var(--cream);
    overflow: hidden;
    padding: 0;
}

.gallery-strip {
    display: flex;
    gap: 0;
}

.gallery-item {
    flex: 1;
    aspect-ratio: 3/4;
    overflow: hidden;
}

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

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

/* ─── Story Section ──────────────────────── */
.story-section {
    background: var(--rose-deep);
    /* Your signature red */
    color: var(--cream);
    padding: 2.5rem 0 6rem 0; /* Reduced top padding from 6rem */
}

.story-section .script-heading {
    color: var(--cream);
}

.story-section .serif-label {
    color: var(--rose-light);
    margin-bottom: 0;
}

.story-header {
    margin-bottom: 2rem;
}

.story-divider {
    width: 40px;
    height: 1px;
    background: var(--rose-light);
    margin: 1.5rem auto;
    opacity: 0.4;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 1.5rem;
    /* Increased vertical gap */
    margin-top: 4rem;
    padding: 0 1.5rem;
}

.story-photo {
    aspect-ratio: 3 / 4;
    /* Editorial vertical ratio */
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.8s ease;
}

.story-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.2, 1, 0.3, 1);
}

/* Interactivity / Hover */
.story-photo:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(161, 35, 34, 0.15);
    z-index: 10;
}

.story-photo:hover img {
    transform: scale(1.1);
}

/* Editorial Staggered Layout */
.item-1 {
    transform: translateY(0);
}

.item-2 {
    transform: translateY(4rem);
}

.item-3 {
    transform: translateY(0);
}

.item-4 {
    transform: translateY(4rem);
}

/* Ensure reveal animation works with offsets */
.story-grid.reveal.visible .item-1 {
    animation: revealStagger 1s ease forwards 0.1s;
}

.story-grid.reveal.visible .item-2 {
    animation: revealStagger 1s ease forwards 0.3s;
}

.story-grid.reveal.visible .item-3 {
    animation: revealStagger 1s ease forwards 0.2s;
}

.story-grid.reveal.visible .item-4 {
    animation: revealStagger 1s ease forwards 0.4s;
}

@keyframes revealStagger {
    from {
        opacity: 0;
        transform: translateY(6rem);
    }

    to {
        opacity: 1;
        transform: translateY(var(--offset, 0));
    }
}

/* Adjusting offsets for the animation context */
.item-1 {
    --offset: 0;
}

.item-2 {
    --offset: 4rem;
}

.item-3 {
    --offset: 0;
}

.item-4 {
    --offset: 4rem;
}

/* ─── Photo Section ─────────────────── */
.photo-section {
    position: relative;
    background: var(--cream);
    overflow: hidden;
    line-height: 0;
}

.photo-container {
    width: 100%;
    position: relative;
}

.couple-photo-main {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.story-text {
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--cream);
    /* Ensure readability */
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

/* ─── Details / Timeline ─────────────────── */
.details-section {
    background: var(--cream-dark);
}

.details-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.detail-row {
    display: grid;
    grid-template-columns: 75px 1fr;
    /* Wider column for the time */
    gap: 1.5rem;
    align-items: flex-start;
    text-align: left;
}

.detail-num {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--rose-deep);
    /* Accent color as requested */
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.detail-content h3 {
    font-family: var(--font-serif);
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--text-dark);
    /* Darker for better contrast */
    margin-bottom: 0.4rem;
}

.detail-content p {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Venue / Map ────────────────────────── */
.venue-section {
    background: white;
}

.venue-name {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    /* Increased for photo */
}

.venue-photo-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border-radius: 4px;
    line-height: 0;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
    /* Sophisticated lift */
}

.venue-photo {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 1.2s ease;
}

.venue-photo-container:hover .venue-photo {
    transform: scale(1.05);
}

.venue-address {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-family: var(--font-sans);
}

.map-btn {
    display: inline-block;
    padding: 0.75rem 2.2rem;
    background: transparent;
    border: 1px solid var(--rose);
    color: var(--rose-deep);
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
    margin-bottom: 2rem;
}

.map-btn:hover {
    background: var(--rose);
    color: white;
}

/* ─── RSVP ───────────────────────────────── */
.rsvp-section {
    background: var(--cream-dark);
}

.rsvp-card {
    background: white;
    border: 1px solid rgba(196, 139, 139, 0.25);
    padding: 3rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}

.rsvp-card p {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.rsvp-form input[type="text"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(196, 139, 139, 0.35);
    background: transparent;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-dark);
    outline: none;
    margin-bottom: 1.8rem;
    transition: border-color 0.3s;
}

.rsvp-form input:focus {
    border-color: var(--rose);
}

.rsvp-options {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 2rem;
    text-align: left;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--rose);
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s;
}

.radio-label input:checked~.radio-dot {
    background: var(--rose);
    box-shadow: inset 0 0 0 3px white;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--rose-deep);
    color: white;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: var(--rose);
}

/* ─── Dress Code ─────────────────────────── */
.dresscode-section {
    background: white;
}

.dresscode-section .story-text {
    color: var(--text-dark);
    /* Ensure visibility on white background */
    margin-bottom: 2rem;
}

.palette-row {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.swatch-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    transition: transform 0.35s;
}

.swatch:hover .swatch-circle {
    transform: translateY(-4px);
}

.swatch span {
    font-family: var(--font-sans);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ─── Footer ─────────────────────────────── */
.footer {
    background: var(--cream);
    /* Solid background to block Hero */
    padding: 0;
    position: relative;
    text-align: center;
    overflow: hidden;
    z-index: 100;
    /* High z-index to stay above sticky hero */
    min-height: 600px;
    /* Strong coverage */
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-envelope {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: url('11.webp') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Logic for upper/lower distribution */
    gap: 3rem;
    /* Spacing between the two halves */
    position: relative;
}

.footer-with-love {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--rose-deep);
    opacity: 0.8;
    font-style: italic;
    transform: translateY(-20px);
    /* Move towards top half */
    line-height: 1.4;
    padding: 0 20px;
}

.footer-names {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--rose-deep);
    opacity: 0.9;
    transform: translateY(95px);
    /* Moved even lower as requested */
    line-height: 1.4;
    padding: 0 20px;
}

/* ─── Media Queries ──────────────────────── */
@media (max-width: 480px) {

    .name-main,
    .name-second {
        font-size: 4rem;
    }

    .script-heading {
        font-size: 2.8rem;
    }

    .container {
        padding: 4rem 1.5rem;
    }

    .gallery-strip {
        flex-direction: column;
    }

    .gallery-item {
        aspect-ratio: 4/3;
    }

    .rsvp-card {
        padding: 2rem 1.5rem;
    }

    .invitation-text {
        padding: 1rem;
        font-size: 1.25rem;
        max-width: 100%;
    }

    .hero-pretitle {
        top: 10%;
    }
}