/* =========================================
   Design System & Variables
   ========================================= */
:root {
    /* Colors from the design */
    --bg-sage: #710926;
    /* Deep Maroon background */
    --bg-cream: #fbf8f1ef;
    --bg-tp: #fbf8f100;
    /* Cream background */
    --text-dark: #3a2e28;
    /* Dark brown text */
    --text-red: #710927;
    /* Theme Red/Maroon */
    --gold: #b58c4f;
    /* Theme Gold accents */
    --gold-dark: #a87941;
    /* Darker theme gold */
    --envelope-green: #710927;
    /* Envelope maroon */
    --seal-gold: #b58c4f;
    /* Seal gold */

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

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-cream);
    background-image: url('images/wedding-hero-plain.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-dark);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body.no-scroll {
    overflow: hidden;
}

/* =========================================
   Screen Management
   ========================================= */
.screen {
    width: 100%;
    min-height: 100vh;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    position: absolute !important;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* =========================================
   Envelope Screen
   ========================================= */
#envelope-screen {
    background-color: var(--bg-sage);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.floating-flowers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.flower {
    position: absolute;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    animation: float 15s infinite linear;
    animation-fill-mode: both;
}

@keyframes float {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 0.7;
    }

    80% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.envelope-container {
    position: relative;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.5s ease;
    width: 400px;
    /* Adjust based on image size */
    max-width: 80vw;
    max-height: 50vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
}

.envelope-container:hover {
    transform: scale(1.02);
}

.animated-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-color: rgb(113 9 38);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    z-index: 20;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: colorPulse 4s ease-in-out infinite alternate;
}

@keyframes colorPulse {
    0% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.envelope-text-container {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    width: 100%;
}

.envelope-title {
    font-family: var(--font-script);
    font-size: 54px;
    color: var(--gold);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px #3d0012;
}

.click-instruction {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Envelope Opening Animation */
.envelope-zoom-out {
    animation: zoomOut 1.2s forwards;
}

@keyframes zoomOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    30% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(3) translateY(-100px);
        opacity: 0;
        visibility: hidden;
    }
}

/* =========================================
   Main Content Layout
   ========================================= */
.section {
    padding: 40px 20px;
    text-align: center;
    width: 100%;
}

.section-title {
    font-family: var(--font-script);
    font-size: 42px;
    color: var(--gold);
    margin-bottom: 10px;
    font-weight: 400;
}

.section-divider {
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    margin: 15px auto 30px auto;
    transform: rotate(45deg);
}

.section-divider.small {
    margin-bottom: 20px;
}

.creative-underline {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -5px auto 25px auto;
    width: 60%;
    max-width: 250px;
}

.creative-underline::before,
.creative-underline::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.creative-underline span {
    margin: 0 10px;
    color: var(--gold);
    font-size: 12px;
}

/* =========================================
   Header Section
   ========================================= */
.header-section {
    position: relative;
    padding: 0;
    max-width: 100%;
    overflow: hidden;
}

.header-img-container {
    position: relative;
    width: 100%;
    line-height: 0;
}

.header-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/11;
    object-fit: cover;
    object-position: top;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient removed, relying on natural faint mandala */
    pointer-events: none;
}

.header-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    padding: 20px;
}

.ganesha-logo {
    margin-top:230px;
    margin-bottom: 20px;
}

.shree-text {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-red);
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.intro-text {
    font-size: 14px;
    max-width: 500px;
    margin: 0 auto 40px auto;
    line-height: 1.6;
    color: #666;
}

.couple-names {
    margin-bottom: 50px;
}

.couple-names .name {
    font-family: var(--font-script);
    font-size: 64px;
    color: var(--text-red);
    font-weight: 400;
    margin: 10px 0;
}

.couple-names .parents-name {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.couple-names .with {
    font-family: var(--font-script);
    font-size: 32px;
    color: var(--text-dark);
    margin: 15px 0;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.primary-btn {
    background: linear-gradient(to right, #dca85b, #e6c888, #dca85b);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 168, 91, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 168, 91, 0.5);
}

.secondary-btn {
    background-color: var(--gold);
    color: white;
    margin-top: 20px;
}

/* =========================================
   Events Section
   ========================================= */
.events-section {
    background-color: var(--bg-sage);
    padding-top: 80px;
    padding-bottom: 80px;
    position: relative;
}

.events-section::before,
.events-section::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23d4af37" xmlns="http://www.w3.org/2000/svg"><path d="M12 0L14.59 9.41L24 12L14.59 14.59L12 24L9.41 14.59L0 12L9.41 9.41L12 0Z"/></svg>') no-repeat center;
    opacity: 0.5;
}

.events-section::before {
    top: 20px;
    left: 20px;
}

.events-section::after {
    bottom: 20px;
    right: 20px;
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin: 40px auto 0 auto;
    max-width: 500px;
    padding: 0 20px;
}

.event-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
}

.event-card.full-width {
    grid-column: 1 / -1;
}

.event-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 0.5s ease;
}

.event-card:hover .event-bg {
    transform: scale(1.05);
}

.event-content {
    position: relative;
    z-index: 2;
    padding: 5%;
    width: 100%;
    color: white;
    text-align: center;
}

/* Layout Variations */
.event-card.content-center {
    justify-content: center;
}

.event-card.content-center .event-content {
    width: 100%;
}

.event-card.content-right {
    justify-content: flex-end;
}

.event-card.content-right .event-content {
    width: 48%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: 13%;
}

/* Dark Theme Variant */
.event-card.text-dark .event-content {
    color: var(--text-red);
}

.event-card.text-dark .event-title {
    color: var(--gold);
    text-shadow: none;
}

.event-card.text-dark .event-subtitle {
    opacity: 0.9;
    color: var(--text-red);
}

.event-card.text-dark .event-details strong {
    color: var(--gold);
}

.event-title {
    font-family: var(--font-script);
    font-size: 36px;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.event-subtitle {
    font-size: 12px;
    font-style: italic;
    margin-bottom: 20px;
    opacity: 0.9;
}

.event-details {
    font-size: 13px;
    line-height: 1.8;
}

.event-details strong {
    color: var(--gold);
    font-weight: 500;
}

/* =========================================
   Families Section
   ========================================= */
.pre-title {
    font-family: var(--font-heading);
    font-size: 10px;
    color: var(--text-dark);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.families-section {
    background-color: var(--bg-sage);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    padding-bottom: 80px;
}

.families-section .pre-title,
.families-section .section-title,
.families-section .family-label {
    color: var(--gold);
}

.families-section .family-card p {
    color: var(--bg-cream);
}

.family-card {
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 60px 20px;
    max-width: 900px;
    margin: 40px auto 0 auto;
}

.family-label {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 3px;
    color: #6a7c59;
    margin-bottom: 5px;
}

.flower-divider {
    color: var(--gold);
    font-size: 14px;
    margin: 10px 0 20px 0;
}

.family-card p {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-dark);
    font-family: var(--font-heading);
}

/* =========================================
   Location Section
   ========================================= */
.location-section {
    background-color: var(--bg-tp);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    padding-bottom: 80px;
}

.location-text {
    font-size: 14px;
    margin-bottom: 30px;
    color: #666;
    font-family: var(--font-body);
}

.map-container {
    max-width: 900px;
    margin: 0 auto 30px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.get-directions-btn {
    background: linear-gradient(135deg, var(--gold), #e9c46a);
    color: white;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 1px;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(205, 161, 83, 0.3);
    transition: all 0.3s ease;
}

.get-directions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 161, 83, 0.4);
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background-color: var(--bg-sage);
    /* Deep Maroon */
    color: var(--bg-cream);
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-content {
    position: relative;
    z-index: 10;
}

.footer-names {
    font-family: var(--font-script);
    font-size: 56px;
    color: var(--gold);
    margin-bottom: 25px;
    font-weight: 400;
}

.footer-bouquet {
    font-size: 24px;
    margin-bottom: 25px;
}

.footer-date {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--bg-cream);
}

.footer-hashtag {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--bg-cream);
    opacity: 0.8;
}

/* =========================================
   Animations & Utilities
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   Audio Toggle Button
   ========================================= */
.audio-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(56, 37, 24, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.audio-toggle-btn:hover {
    background-color: rgba(56, 37, 24, 1);
    transform: scale(1.05);
}

.audio-toggle-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .couple-names .name {
        font-size: 48px;
    }

    .couple-names .with {
        font-size: 24px;
    }

    .section-title {
        font-size: 36px;
    }

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

    .event-card.content-right .event-content {
        width: 60%;
        margin-right: 8%;
    }
    
    .event-card.content-right .event-subtitle {
        font-size: 10px;
    }
    
    .event-card.content-right .event-details {
        font-size: 11px;
    }

    .event-title {
        font-size: 26px !important;
    }

    .header-img {
        min-height: 450px;
    }

    .ganesha-logo {
        margin-top: 150px;
    }

    .ganesha-logo img {
        width: 90px;
    }
}

@media (max-width: 480px) {
    .header-img {
        min-height: 520px;
    }

    .ganesha-logo {
        margin-top: 150px;
    }

    .ganesha-logo img {
        width: 70px;
    }

    .couple-names .name {
        font-size: 38px;
    }

    .intro-text {
        font-size: 13px !important;
        margin-bottom: 20px;
    }
}

/* =========================================
   Scratch Section
   ========================================= */
.scratch-section {
    background-color: var(--bg-tp);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
}

.scratch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
    width: 100%;
}

.scratch-card-wrapper {
    position: relative;
    width: 500px;
    height: 140px;
    max-width: 90vw;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-color: transparent;
    z-index: 10;
    border: 1px solid var(--gold);
}

.scratch-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
}

.reveal-text {
    font-family: var(--font-script);
    font-size: 32px;
    color: var(--text-red);
    margin-bottom: 15px;
}

#scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    cursor: crosshair;
    z-index: 15;
}

.scratch-overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    color: white;
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 2px;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s;
}

.scratch-overlay-text .emoji {
    font-size: 20px;
}

/* =========================================
   Countdown Timer
   ========================================= */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    transition: max-height 0.8s ease, margin-top 0.8s ease, opacity 0.8s ease, transform 0.8s ease;
}

.countdown-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
}

.countdown-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 150px;
    margin-top: 40px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-box {
    width: 70px;
    height: 70px;
    background-color: transparent;
    border: 1px solid var(--gold);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--text-red);
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.4);
}

.countdown-label {
    font-family: var(--font-heading);
    font-size: 9px;
    letter-spacing: 2px;
    color: #6a7c59;
    text-transform: uppercase;
}