:root {
    --bg-cream: #fdfbf7;
    --bg-teal: #1a3c40;
    --bg-yellow: #fceb9e;
    --text-gold: #c5a059;
    --text-teal: #1a3c40;
    --text-cream: #fdfbf7;
    --accent-magenta: #d3226a;
    
    --font-heading: 'Cinzel', serif;
    --font-script: 'Alex Brush', cursive;
    --font-body: 'Lora', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-cream);
    color: var(--text-teal);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
}

.script-text {
    font-family: var(--font-script);
}

/* Flower Raining Animation */
#flower-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.falling-flower {
    position: absolute;
    top: -50px;
    user-select: none;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    background-color: var(--bg-teal);
    color: var(--text-gold);
    padding: 20px 5% 4rem 5%;
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

/* Background Mandalas */
.mandala {
    position: absolute;
    opacity: 0.3; /* Subtle in background */
    z-index: 0;
    pointer-events: none;
    animation: spin 60s linear infinite;
    mix-blend-mode: lighten; /* Blends dark teal backgrounds together */
}

.mandala-1 {
    top: -10%;
    left: -15%;
    width: 600px;
    animation-duration: 80s;
}

.mandala-2 {
    bottom: -20%;
    right: -10%;
    width: 500px;
    animation-direction: reverse;
    animation-duration: 120s;
}

.mandala-3 {
    top: 20%;
    left: 45%;
    width: 250px;
    opacity: 0.15;
    animation-duration: 50s;
}

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

.hero-decoration {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}
.hero-decoration::before {
    content: '❁ ❁ ❁';
    letter-spacing: 15px;
    color: var(--text-gold);
    opacity: 0.7;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.hero-text {
    flex: 1;
    text-align: center;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.couple-names {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    align-items: center;
    font-family: var(--font-script);
    font-size: 7rem;
    line-height: 0.9;
    margin-bottom: 1.5rem;
    color: #e63946; /* Elegant red matching the image */
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8), 3px 3px 5px rgba(0,0,0,0.2);
    transform: rotate(-2deg);
}

.couple-names .name {
    display: block;
}

.couple-names .ampersand {
    font-size: 4rem;
    margin: -10px 0;
}

.title {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.4;
    color: var(--text-gold);
    letter-spacing: 2px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--bg-cream);
    color: var(--text-teal);
    border: 2px solid var(--bg-cream);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--bg-cream);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-gold);
    border: 2px solid var(--text-gold);
}

.btn-outline:hover {
    background-color: var(--text-gold);
    color: var(--bg-teal);
}

/* Intro Section */
.intro {
    background-color: var(--bg-yellow);
    padding: 5rem 10%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
}

.marigold {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    background-image: url('assets/images/marigold.png');
    background-size: contain;
    background-repeat: repeat-y;
}

.marigold.left {
    left: 20px;
}

.marigold.right {
    right: 20px;
}

.intro-content {
    text-align: center;
    max-width: 800px;
    z-index: 10;
}

.intro h2 {
    color: var(--text-teal);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.intro p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-teal);
}

.btn-dark {
    background-color: var(--bg-teal);
    color: var(--text-cream);
    border: 2px solid var(--bg-teal);
}

.btn-dark:hover {
    background-color: transparent;
    color: var(--text-teal);
}

/* About Section */
.about {
    background-color: var(--bg-cream);
    padding: 6rem 5%;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-scroll {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.about-scroll::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('assets/images/scroll.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.scroll-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 60%;
    padding: 2rem;
}

.scroll-title {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--text-gold);
    font-weight: 400;
    margin-bottom: 1rem;
}

.scroll-content p {
    color: var(--text-gold);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.scroll-link {
    color: var(--text-gold);
    text-decoration: underline;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.about-text {
    flex: 1;
}

.sun-decorations {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    color: var(--text-gold);
    font-size: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-teal);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .about-container {
        flex-direction: column;
    }
    
    .marigold {
        width: 30px;
    }
    
    .scroll-title {
        font-size: 2rem;
    }
    
    .scroll-content p {
        font-size: 0.8rem;
    }
}

/* Envelope Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn {
    position: absolute;
    top: 0; right: 20px;
    background: none; border: none;
    color: white; font-size: 3rem;
    cursor: pointer;
}

/* Envelope Animation */
.envelope-wrapper {
    position: relative;
    width: 400px;
    height: 250px;
    cursor: pointer;
    perspective: 1000px;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1s ease;
}

.envelope-front, .envelope-back, .envelope-flap {
    position: absolute;
    width: 100%;
    height: 100%;
}

.envelope-back {
    background: #d4af37; /* Gold base */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.envelope-front {
    background: #b89125;
    z-index: 3;
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.envelope-flap {
    background: #cba22c;
    z-index: 4;
    transform-origin: top;
    border: 2px solid var(--bg-teal);
}

.btn-dark:hover {
    background-color: transparent;
    color: var(--text-teal);
}

/* About Section */
.about {
    background-color: var(--bg-cream);
    padding: 6rem 5%;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-scroll {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.about-scroll::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('assets/images/scroll.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.scroll-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 60%;
    padding: 2rem;
}

.scroll-title {
    font-family: var(--font-script);
    font-size: 3.5rem;
    color: var(--text-gold);
    font-weight: 400;
    margin-bottom: 1rem;
}

.scroll-content p {
    color: var(--text-gold);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.scroll-link {
    color: var(--text-gold);
    text-decoration: underline;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.about-text {
    flex: 1;
}

.sun-decorations {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    color: var(--text-gold);
    font-size: 2rem;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-teal);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .couple-names {
        font-size: 3.5rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .couple-names .ampersand {
        font-size: 3rem;
    }

    .title {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    .about-container {
        flex-direction: column;
    }
    
    .marigold {
        width: 30px;
    }
    
    .scroll-title {
        font-size: 2rem;
    }
    
    .scroll-content p {
        font-size: 0.8rem;
    }
}

/* Envelope Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn {
    position: absolute;
    top: 0; right: 20px;
    background: none; border: none;
    color: white; font-size: 3rem;
    cursor: pointer;
}

/* Envelope Animation */
.envelope-wrapper {
    position: relative;
    width: 400px;
    height: 250px;
    cursor: pointer;
    perspective: 1000px;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1s ease;
}

.envelope-front, .envelope-back, .envelope-flap {
    position: absolute;
    width: 100%;
    height: 100%;
}

.envelope-back {
    background: #d4af37; /* Gold base */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.envelope-front {
    background: #b89125;
    z-index: 3;
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.envelope-flap {
    background: #cba22c;
    z-index: 4;
    transform-origin: top;
    transition: transform 0.8s ease, z-index 0.1s 0.3s;
    clip-path: polygon(0 0, 100% 0, 50% 60%);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

/* Open state */
.envelope-wrapper.open {
    transform: scale(0.95);
}

.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
    transition: transform 0.8s ease, z-index 0.1s 0.3s;
}

.voucher-card {
    position: absolute;
    bottom: 10px;
    left: 5%;
    width: 90%;
    height: 90%;
    z-index: 2;
    transition: transform 1s 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 1s 0.8s ease;
    background: #f4f1eb;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.envelope-wrapper.open .voucher-card {
    transform: translateY(-150px) scale(1.15);
    z-index: 5;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 1s 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0.1s 0.6s, box-shadow 1s 0.6s ease;
}

/* Ribbons */
.ribbon {
    position: absolute;
    background: #c1121f;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    width: 150px;
    height: 25px;
}

.ribbon-tl {
    top: 15px;
    left: -45px;
    transform: rotate(-45deg);
}

.ribbon-br {
    bottom: 15px;
    right: -45px;
    transform: rotate(-45deg);
}

/* Voucher Content */
.voucher-card h3 {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.4rem;
    color: #4a4a4a;
    margin-bottom: 2px;
}

.voucher-card h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #c5a059;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.voucher-card .divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.voucher-card .divider::before,
.voucher-card .divider::after {
    content: '';
    width: 25px;
    height: 1px;
    background: #c5a059;
}

.qr-code {
    width: 70px;
    height: 70px;
    background: white;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Sparkles Effect */
.sparkle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    animation: pop 0.8s ease-out forwards;
    z-index: 99999;
}

@keyframes pop {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1) translate(var(--tx), var(--ty)); opacity: 0; }
}

@media (max-width: 768px) {
    .envelope-wrapper {
        width: 300px;
        height: 180px;
    }
    .envelope-wrapper.open .voucher-card {
        transform: translateY(-110px) scale(1.1);
    }
}
