/* CSS Design System for Rahul & Avishi's Wedding Invitation */

/* CSS Variables */
:root {
    --primary-color: #9B2C39; /* Crimson Red / Kumkum Red */
    --primary-light: #B83C4B;
    --accent-gold: #C5A880; /* Elegant Soft Gold */
    --accent-gold-bright: #D4AF37; /* Metallic Gold */
    --accent-gold-dark: #8F7249;
    --canvas-bg: #FFFDF9; /* Soft Warm Ivory */
    --card-bg: #F8F3EA; /* Warm Cream */
    --text-dark: #2A2E2B; /* Deep Charcoal */
    --text-light: #7D736A; /* Soft Warm Taupe */
    --white: #FFFFFF;
    
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', Helvetica, Arial, sans-serif;
    
    --transition-smooth: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-quick: all 0.25s ease;
    
    --box-shadow-soft: 0 10px 30px rgba(155, 44, 57, 0.06);
    --box-shadow-medium: 0 15px 40px rgba(155, 44, 57, 0.12);
    --box-shadow-gold: 0 15px 35px rgba(197, 168, 128, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--canvas-bg);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#petalCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1005;
}

/* Typography Selection */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: 0.03em;
}

p {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-quick);
}

/* Helper Components */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.small-container {
    width: 90%;
    max-width: 650px;
    margin: 0 auto;
}

.section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold-dark);
    margin-top: 10px;
}

.decorative-line {
    width: 100px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    margin: 0 auto;
    position: relative;
}

.decorative-line::after {
    content: "❖";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: var(--accent-gold-bright);
    background-color: var(--canvas-bg);
    padding: 0 8px;
}

.events-section .decorative-line::after {
    background-color: var(--card-bg);
}

/* Floating Audio Control */
.music-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--canvas-bg);
    color: var(--accent-gold);
    border: 2.5px solid var(--accent-gold-bright);
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(26, 58, 43, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    transition: var(--transition-quick);
    overflow: hidden;
    padding: 0;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
    border-color: var(--white);
}

.music-toggle-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: transform 0.4s ease;
    filter: grayscale(85%) opacity(0.85); /* Slightly grey and transparent when paused */
}

.music-toggle:hover .music-toggle-logo {
    filter: none;
}

.music-toggle.playing .music-toggle-logo {
    filter: none; /* Full color when playing */
    animation: spin-logo-slow 10s linear infinite;
}

@keyframes spin-logo-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-notes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.music-notes .note {
    position: absolute;
    font-size: 14px;
    color: var(--accent-gold-bright);
    opacity: 0;
    animation: float-note 2.5s infinite linear;
}

.music-notes .note:nth-child(1) {
    top: -10px;
    left: 10px;
    animation-delay: 0s;
}

.music-notes .note:nth-child(2) {
    top: -20px;
    left: 25px;
    animation-delay: 0.8s;
}

.music-notes .note:nth-child(3) {
    top: -10px;
    left: 40px;
    animation-delay: 1.6s;
}

@keyframes float-note {
    0% {
        transform: translateY(0) scale(0.6);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-40px) translateX(10px) rotate(20deg) scale(1.1);
        opacity: 0;
    }
}

/* Scroll Animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.215, 0.61, 0.355, 1),
                transform 1s cubic-bezier(0.215, 0.61, 0.355, 1);
}

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

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    transition: transform 10s ease-out;
}

.hero-section:hover .hero-bg {
    transform: scale(1.01);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(155, 44, 57, 0.45) 0%, rgba(77, 15, 23, 0.88) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 0 20px;
}

.hero-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-gold-bright);
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 25px;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.55);
    font-style: italic;
    color: var(--white);
}

.hero-date {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    margin-bottom: 40px;
    text-transform: uppercase;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 0;
    display: inline-block;
    color: var(--white) !important; /* Forces inheritance override */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cta-button {
    display: inline-block;
    padding: 12px 35px;
    background-color: var(--accent-gold-bright);
    color: var(--primary-color);
    border: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35);
}

.cta-button:hover {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.65);
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    margin-top: 5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }
    40% {
        transform: translate(-50%, -10px);
    }
    60% {
        transform: translate(-50%, -5px);
    }
}

/* Countdown Clock */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 50px;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 90px;
    height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: var(--transition-quick);
}

.countdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-gold-bright);
    transform: scale(1.05);
}

.countdown-number {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--white);
    line-height: 1;
}

.countdown-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold-bright);
    margin-top: 4px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
}

.welcome-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.8;
    color: var(--primary-color);
    font-style: italic;
    margin-bottom: 25px;
}

.story-text {
    max-width: 750px;
    margin: 0 auto;
}

/* Families Section */
.families-section {
    background-color: #FAF4ED; /* Warm Ivory Paper Background */
    text-align: center;
    padding: 80px 0;
}

.families-sub {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: var(--accent-gold-dark);
    display: block;
    margin-bottom: 5px;
}

.families-title {
    font-family: 'Pinyon Script', cursive;
    font-size: 4rem;
    color: #9B2C39; /* Deep maroon/kumkum red color from reference image */
    margin: 0;
    line-height: 1.2;
}

.families-card {
    background-color: var(--canvas-bg);
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 50px 30px;
    box-shadow: var(--box-shadow-soft);
    max-width: 750px;
    margin: 40px auto 0 auto;
    position: relative;
    overflow: hidden;
}

.families-card::after {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(197, 168, 128, 0.45);
    pointer-events: none;
    border-radius: 8px;
}

.gracious-presence {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent-gold-dark);
    display: block;
    margin-bottom: 35px;
}

.families-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 30px;
}

.family-side {
    padding: 10px;
}

.side-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
}

.parent-name {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    color: var(--primary-color);
    margin: 5px 0;
    font-style: italic;
}

.family-divider {
    width: 1px;
    height: 90px;
    background-color: rgba(197, 168, 128, 0.4);
}

/* Events Section */
.events-section {
    background-color: var(--card-bg);
}

.events-rows-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 40px;
    width: 100%;
}

.event-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 30px;
    align-items: stretch;
    width: 100%;
}

/* Alternate row layouts on large screens for visual interest */
@media (min-width: 992px) {
    .event-row:nth-child(even) {
        grid-template-columns: 1.6fr 1fr;
    }
    .event-row:nth-child(even) .event-card {
        order: 2;
    }
    .event-row:nth-child(even) .event-map-container {
        order: 1;
    }
}

.event-map-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(197, 168, 128, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    height: 100%;
    min-height: 485px; /* Matches the event card height! */
    transition: var(--transition-smooth);
}

.event-row:hover .event-map-container {
    border-color: var(--accent-gold-bright);
    box-shadow: 0 15px 40px rgba(155, 44, 57, 0.15);
}

/* Adjust stacking order and direction for smaller viewports (mobile/tablet) */
@media (max-width: 991px) {
    .event-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .event-map-container {
        min-height: 280px;
        height: 280px;
    }
    .event-row:nth-child(even) .event-card {
        order: unset;
    }
    .event-row:nth-child(even) .event-map-container {
        order: unset;
    }
}

.event-card {
    height: 485px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(197, 168, 128, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    box-sizing: border-box;
}

.event-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.15) 35%, rgba(0,0,0,0.7) 65%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
    transition: var(--transition-quick);
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 45px rgba(155, 44, 57, 0.35);
    border-color: var(--accent-gold-bright);
}

.event-card:hover .event-card-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 30%, rgba(0,0,0,0.75) 60%, rgba(0,0,0,0.96) 100%);
}

.event-card-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 10px 5px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: var(--transition-quick);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
}

.event-card:hover .event-card-inner {
    background: transparent;
    border-color: transparent;
}

.event-card.featured {
    border: 1.5px solid var(--accent-gold-bright);
    box-shadow: 0 15px 45px rgba(155, 44, 57, 0.25);
}

.event-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 30px;
    margin-bottom: 12px;
}

.event-badge.gold {
    background-color: var(--accent-gold-bright);
    color: var(--primary-color);
}

.event-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--white);
    margin-bottom: 10px;
    font-style: italic;
    text-align: center;
}

.event-date-time {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
}

.card-icon {
    color: var(--accent-gold-bright);
}

.event-divider {
    width: 50px;
    height: 1px;
    background-color: rgba(212, 175, 55, 0.6);
    margin: 0 auto 15px auto;
}

.event-location-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-gold-bright);
    margin-bottom: 4px;
}

.event-location-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 15px;
    font-style: italic;
    text-align: center;
}

.event-map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 20px;
    background-color: transparent;
    color: var(--accent-gold-bright);
    border: 1px solid var(--accent-gold-bright);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition-quick);
    cursor: pointer;
    text-decoration: none;
}

.event-map-btn:hover {
    background-color: var(--accent-gold-bright);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
    transform: translateY(-1px);
}





/* Logo Styling */
.hero-logo-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold-bright);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    margin: 0 auto 25px auto;
    display: block;
    object-fit: cover;
}

.story-logo-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid var(--accent-gold);
    box-shadow: var(--box-shadow-soft);
    margin: 0 auto 15px auto;
    display: block;
    object-fit: cover;
}

.footer-logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-gold-bright);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    margin: 0 auto 20px auto;
    display: block;
    object-fit: cover;
}

/* Footer Section */
.footer-section {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 80px 0;
    border-top: 3px solid var(--accent-gold);
}

.footer-tagline {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* Footer Helpline Styles */
.footer-help-container {
    margin: 0 auto 40px auto;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(197, 168, 128, 0.15);
    border-radius: 8px;
    display: block;
    max-width: 600px;
    width: 90%;
}

.help-title {
    font-family: var(--font-heading);
    color: var(--accent-gold-bright);
    font-size: 1.25rem;
    margin-bottom: 18px;
    letter-spacing: 0.05em;
}

.contact-numbers {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--white);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition-quick);
    display: flex;
    align-items: center;
}

.contact-link:hover {
    color: var(--accent-gold-bright);
}

.contact-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 6px;
}

/* Footer Social Styles */
.footer-social-container {
    margin-bottom: 40px;
}

.instagram-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 25px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--accent-gold-bright);
    color: var(--accent-gold-bright);
    transition: var(--transition-quick);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
}

.instagram-btn:hover {
    background-color: var(--accent-gold-bright);
    color: var(--primary-color);
    box-shadow: var(--box-shadow-gold);
    transform: translateY(-3px);
}

.instagram-username {
    font-family: var(--font-body);
}

.footer-copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.05em;
}

/* Invitation Envelope Cover Overlay Styles */
.envelope-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background-color: #FAF4ED; /* Elegant Light Cream Paper Background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}

.envelope-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope-wrapper {
    position: relative;
    width: 300px;
    height: 200px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease;
}

.envelope-wrapper:hover {
    transform: scale(1.04);
}

.envelope-wrapper.open:hover {
    transform: none;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background-color: #88222B; /* Darker Crimson */
    border-radius: 6px;
    z-index: 1;
}

.envelope-letter {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 180px;
    transform: translate(-50%, -50%) translateY(5px);
    background-image: url('images/hero_indian.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.5s, 
                width 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                border-radius 0.3s ease, 
                box-shadow 0.3s ease;
}

.letter-inner {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 253, 249, 0.88);
    border: 1px solid rgba(197, 168, 128, 0.3);
    border-radius: 3px;
    margin: 4px;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.letter-inner > * {
    transition: opacity 0.3s ease;
}

.letter-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--accent-gold);
    margin-bottom: 8px;
    object-fit: cover;
}

.letter-invite-text {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-light);
    margin-bottom: 4px;
}

.letter-names {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.letter-date {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--accent-gold);
    font-weight: 500;
}

.envelope-wrapper.open .envelope-letter {
    transform: translate(-50%, -50%) translateY(-90px);
}

/* Page Expansion States */
.envelope-overlay.expand-active .envelope-letter {
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%) translateY(0) !important;
    border-radius: 0;
    box-shadow: none;
    z-index: 1009;
    /* Remove transform and dimensional transition delays during expansion */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                width 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                border-radius 0.3s ease, 
                box-shadow 0.3s ease;
}

.envelope-overlay.expand-active .letter-inner {
    background-color: rgba(255, 253, 249, 0);
    border-color: transparent;
}

.envelope-overlay.expand-active .letter-inner > * {
    opacity: 0;
}

.envelope-overlay.expand-active .envelope-wrapper {
    opacity: 0;
    pointer-events: none;
}

.envelope-overlay.expand-active .envelope-text-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.envelope-front {
    position: absolute;
    inset: 0;
    z-index: 3;
    transition: opacity 0.3s ease;
}

.envelope-svg {
    display: block;
    border-radius: 6px;
    overflow: hidden;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110px;
    z-index: 4;
    transform-origin: top center;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), z-index 0s 0.5s, opacity 0.5s ease;
}

.flap-svg {
    display: block;
}

.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-seal {
    position: absolute;
    top: 100px;
    left: 150px;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.seal-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--accent-gold-bright);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    object-fit: cover;
    background-color: #fffdf9;
}

.envelope-wrapper.open .envelope-seal {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
    pointer-events: none;
}

.envelope-text-container {
    margin-top: 50px;
    text-align: center;
    color: var(--primary-color);
}

.envelope-main-title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.envelope-hint {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: rgba(155, 44, 57, 0.75);
}

/* Triple Interactive Scratch Cards Styles */
.scratch-cards-wrapper {
    margin: 25px auto;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 15;
}

.scratch-hint {
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 12px;
}

.scratch-cards-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.scratch-card-col {
    position: relative;
    width: 95px;
    height: 110px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fffdf9;
    box-shadow: 0 10px 25px rgba(0,0,0,0.22);
    user-select: none;
    -webkit-user-select: none;
}

.scratch-card-reveal {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fffdf9;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.scratch-card-reveal::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px dashed rgba(197, 168, 128, 0.4);
    pointer-events: none;
    border-radius: 5px;
}

.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    touch-action: none; /* Prevents scrolling while scratching on mobile! */
    cursor: pointer;
    transition: opacity 0.5s ease;
}

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

/* Delayed Reveal Transitions via Wrapper */
.hero-reveal-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: max-height 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                margin-top 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    margin-top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-reveal-wrapper.revealed {
    max-height: 250px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 25px;
}

/* Polaroid Timeline Styles (Scroll-Stacking Effect) */
.polaroid-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 250px; /* Large spacing to allow scroll stacking */
    margin-top: 50px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px 150px 15px; /* Extra bottom padding to let the last card stand */
}

.polaroid-card {
    background: var(--white);
    padding: 15px 15px 25px 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(197, 168, 128, 0.18);
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: sticky;
    top: 150px; /* Sticks at 150px from viewport top */
    width: 290px;
    box-sizing: border-box;
}

.polaroid-card:hover {
    transform: scale(1.05) rotate(0deg) !important;
    box-shadow: 0 20px 40px rgba(197, 168, 128, 0.35);
    z-index: 100 !important; /* Stack above other stuck cards on hover */
}

.polaroid-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #eee;
    border: 1px solid #e2e2e2;
    margin-bottom: 18px;
}

.polaroid-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.polaroid-card:hover .polaroid-image-wrapper img {
    transform: scale(1.06);
}

.polaroid-caption {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.polaroid-milestone {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.polaroid-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
    max-width: 190px;
}

.polaroid-date {
    font-family: 'Pinyon Script', cursive;
    font-size: 1.3rem;
    color: var(--accent-gold-dark);
    margin-top: 2px;
}

/* Responsiveness Styles */
@media (max-width: 992px) {
    .hero-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 70px 0;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .venue-main-title {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-logo-img {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .hero-date {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
    
    .countdown-container {
        gap: 15px;
        margin-bottom: 40px;
    }
    
    .countdown-item {
        width: 70px;
        height: 75px;
    }
    
    .countdown-number {
        font-size: 1.6rem;
    }
    
    .countdown-label {
        font-size: 0.6rem;
    }
    
    .welcome-text {
        font-size: 1.4rem;
    }
    
    .music-toggle {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* Sticky Map Mobile Overrides */
    .map-section-title {
        font-size: 1.8rem;
        top: 25px;
    }
    
    .map-zoom-viewport {
        width: 90vw;
        height: 65vh;
    }
    
    .map-popup-card {
        padding: 20px;
        max-width: 320px;
    }
    
    .popup-title {
        font-size: 1.3rem;
    }
    
    .popup-qr {
        width: 100px;
        height: 100px;
    }
    
    /* Families Section Mobile */
    .families-title {
        font-size: 3rem;
    }
    
    .families-card {
        padding: 35px 20px;
        margin: 25px 15px 0 15px;
    }
    
    .families-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .family-divider {
        width: 60px;
        height: 1px;
        margin: 10px auto;
    }
    
    .parent-name {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .countdown-container {
        gap: 8px;
    }
    
    .countdown-item {
        width: 60px;
        height: 65px;
    }
    
    .countdown-number {
        font-size: 1.3rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .map-section-title {
        font-size: 1.5rem;
    }
    
    .map-zoom-viewport {
        height: 55vh;
    }
}
