/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-dark-1: #0b0914;
    --bg-dark-2: #140d24;
    --bg-dark-3: #08050e;
    
    --color-text-primary: #f8f6fa;
    --color-text-secondary: #cbbccf;
    --color-text-muted: #85748a;
    
    --color-accent-rose: #ff4d6d;
    --color-accent-gold: #ffd166;
    --color-accent-lavender: #b5179e;
    --color-accent-cyan: #4cc9f0;
    --color-accent-aurora: #06d6a0;
    
    --rose-gold-gradient: linear-gradient(135deg, #ffb5a7, #df7a82, #b85042);
    --gold-glow-gradient: linear-gradient(135deg, #ffe17d, #ffd166, #ff9f1c);
    --magic-glow-gradient: linear-gradient(135deg, #ff4d6d, #b5179e, #7209b7);
    
    /* Font Families */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --font-script: 'Sacramento', cursive;
    
    /* Layout Variables */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 32px;
    
    --glass-bg: rgba(20, 15, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: linear-gradient(185deg, var(--bg-dark-1) 0%, var(--bg-dark-2) 50%, var(--bg-dark-3) 100%);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark-3);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 109, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 109, 0.6);
}

/* ==========================================================================
   AMBIENT BACKGROUNDS & ATMOSPHERE
   ========================================================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 50%;
    animation: twinkle var(--twinkle-duration, 3s) infinite ease-in-out;
    opacity: 0.2;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.1; transform: scale(0.8); }
    50% { opacity: 0.9; transform: scale(1.3); }
}

.petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.falling-petal {
    position: absolute;
    display: block;
    pointer-events: none;
    animation: fall var(--fall-duration, 10s) linear infinite;
    transform-origin: center;
    background: linear-gradient(135deg, rgba(255, 77, 109, 0.6), rgba(255, 181, 167, 0.4));
    border-radius: 50% 0 50% 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@keyframes fall {
    0% {
        top: -10%;
        transform: translateX(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        top: 110%;
        transform: translateX(100px) rotate(360deg) scale(0.6);
        opacity: 0;
    }
}

/* Heart Particle (for letter burst) */
.heart-particle {
    position: absolute;
    pointer-events: none;
    z-index: 999;
    animation: burst 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes burst {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(var(--scale)) rotate(var(--rot));
        opacity: 0;
    }
}

/* Audio Control */
.audio-control {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.audio-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--color-accent-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--glass-shadow), 0 0 15px rgba(255, 77, 109, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--glass-shadow), 0 0 25px rgba(255, 77, 109, 0.4);
    color: #fff;
    background: var(--color-accent-rose);
}

.audio-wave {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    margin-left: 2px;
}

.audio-wave span {
    width: 2px;
    background-color: currentColor;
    border-radius: 1px;
    animation: wave 0.8s ease-in-out infinite alternate;
}

.audio-wave span:nth-child(2) { height: 8px; animation-delay: -0.2s; }
.audio-wave span:nth-child(3) { height: 12px; animation-delay: -0.4s; }
.audio-wave span:nth-child(4) { height: 6px; animation-delay: -0.6s; }

.audio-btn.playing .icon-music {
    display: none;
}
.audio-btn.playing .audio-wave {
    display: flex;
}

@keyframes wave {
    0% { height: 2px; }
    100% { height: 12px; }
}

/* Scroll Progress */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent-rose), var(--color-accent-gold));
    z-index: 1000;
    transition: width 0.1s ease;
}

/* ==========================================================================
   TYPOGRAPHY & GLOBAL LAYOUT
   ========================================================================== */
.section {
    padding: 100px 24px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

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

.section-tag {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--color-accent-rose);
    display: block;
    margin-bottom: 12px;
    animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 77, 109, 0.4); }
    50% { text-shadow: 0 0 15px rgba(255, 77, 109, 0.8); }
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 24px;
    text-align: center;
    z-index: 10;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(114, 9, 183, 0.15) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
    line-height: 1.1;
}

.hero-title .highlight {
    font-family: var(--font-script);
    color: var(--color-accent-rose);
    font-size: 6.5rem;
    font-weight: normal;
    text-shadow: 0 0 20px rgba(255, 77, 109, 0.4);
    display: inline-block;
    padding: 0 10px;
    transform: translateY(15px);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
    font-weight: 300;
}

/* Interactive Rose Styling */
.hero-flower-container {
    margin-bottom: 60px;
    cursor: pointer;
    perspective: 800px;
}

.interactive-rose-wrapper {
    position: relative;
    width: 150px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.interactive-rose-wrapper:hover {
    transform: rotateY(15deg) scale(1.05);
}

/* Rose Stem */
.rose-stem {
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 180px;
    background: linear-gradient(to top, #1b4332, #2d6a4f);
    border-radius: 2px;
}

.rose-leaf {
    position: absolute;
    width: 30px;
    height: 18px;
    background: linear-gradient(135deg, #40916c, #1b4332);
    border-radius: 0 15px 0 15px;
    transform-origin: left bottom;
}

.leaf-left {
    left: -28px;
    top: 80px;
    transform: rotate(-30deg);
}

.leaf-right {
    right: -28px;
    top: 50px;
    transform: scaleX(-1) rotate(-40deg);
}

/* Rose Petals */
.rose-petals {
    position: absolute;
    top: 30px;
    width: 80px;
    height: 80px;
    transform-style: preserve-3d;
}

.petal {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, #ff758f 0%, #ff4d6d 60%, #c9184a 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0,0,0,0.1);
    transform-origin: center bottom;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.petal-1 { transform: scale(0.4) rotate(0deg) translateZ(5px) rotateX(35deg); }
.petal-2 { transform: scale(0.4) rotate(72deg) translateZ(10px) rotateX(35deg); }
.petal-3 { transform: scale(0.4) rotate(144deg) translateZ(15px) rotateX(35deg); }
.petal-4 { transform: scale(0.4) rotate(216deg) translateZ(20px) rotateX(35deg); }
.petal-center {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    background: radial-gradient(circle, #ff85a1 0%, #ff4d6d 80%);
    transform: scale(0.4) rotate(288deg) translateZ(25px);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Rose Hover & Click Bloom State */
.interactive-rose-wrapper:hover .petal-1,
.interactive-rose-wrapper.bloom .petal-1 { transform: scale(1.15) rotate(5deg) translateZ(10px) rotateX(15deg); }
.interactive-rose-wrapper:hover .petal-2,
.interactive-rose-wrapper.bloom .petal-2 { transform: scale(1.15) rotate(77deg) translateZ(15px) rotateX(15deg); }
.interactive-rose-wrapper:hover .petal-3,
.interactive-rose-wrapper.bloom .petal-3 { transform: scale(1.15) rotate(149deg) translateZ(20px) rotateX(15deg); }
.interactive-rose-wrapper:hover .petal-4,
.interactive-rose-wrapper.bloom .petal-4 { transform: scale(1.15) rotate(221deg) translateZ(25px) rotateX(15deg); }
.interactive-rose-wrapper:hover .petal-center,
.interactive-rose-wrapper.bloom .petal-center { transform: scale(1.25) rotate(293deg) translateZ(30px) rotateX(5deg); }

.rose-glow-effect {
    position: absolute;
    top: 15px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 77, 109, 0.4) 0%, rgba(255, 77, 109, 0) 70%);
    pointer-events: none;
    z-index: -1;
    animation: roseGlow 3s infinite ease-in-out;
}

@keyframes roseGlow {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.scroll-down-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-secondary);
    transition: color 0.3s;
}

.scroll-down-hint:hover {
    color: var(--color-accent-rose);
}

.chevron-down {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Animations */
.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: opacityFade 1s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-fade-in-delayed {
    opacity: 0;
    transform: translateY(20px);
    animation: opacityFade 1s 0.3s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-scale-up {
    opacity: 0;
    transform: scale(0.8);
    animation: scaleUpFade 1.2s 0.6s forwards cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes scaleUpFade {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   MAGIC CANVAS SECTION (INTERACTIVE GARDEN)
   ========================================================================== */
.garden-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.palette-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    padding: 10px;
    border-radius: 50px;
    box-shadow: var(--glass-shadow);
}

.palette-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-secondary);
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-btn::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--btn-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--btn-color);
}

.palette-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}

.palette-btn.active {
    color: #fff;
    border-color: var(--btn-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05), inset 0 0 5px var(--btn-color);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 500px;
    background: radial-gradient(circle at center, #181135 0%, #090714 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 0 40px rgba(114, 9, 183, 0.15);
    overflow: hidden;
}

#gardenCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.canvas-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: opacity 0.5s ease;
    text-align: center;
}

.canvas-instruction span {
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.canvas-instruction svg {
    animation: floatIcon 3s infinite ease-in-out;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
    50% { transform: translateY(-8px) scale(1.05); opacity: 0.8; }
}

.clear-canvas-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(20, 15, 30, 0.8);
    border: 1px solid var(--glass-border);
    color: var(--color-text-secondary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    z-index: 15;
}

.clear-canvas-btn:hover {
    color: #fff;
    border-color: var(--color-accent-rose);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}

/* ==========================================================================
   BOUQUET BUILDER SECTION
   ========================================================================== */
.bouquet-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: stretch;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
}

.flower-selector {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flower-selector h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #fff;
}

.selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.select-flower-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: left;
}

.select-flower-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.select-flower-btn:active {
    transform: translateY(-1px);
}

.flower-emoji {
    font-size: 2.2rem;
}

.flower-info {
    display: flex;
    flex-direction: column;
}

.flower-name {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.flower-meaning {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Bouquet Controls */
.bouquet-controls {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
}

.ribbon-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.ribbon-selector span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.ribbon-options {
    display: flex;
    gap: 12px;
}

.ribbon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.ribbon-btn.active {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

.action-buttons {
    display: flex;
    gap: 16px;
}

.action-btn {
    flex: 1;
    padding: 14px 28px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-family: var(--font-body);
}

.action-btn.primary {
    background: var(--rose-gold-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 6px 20px rgba(223, 122, 130, 0.3);
}

.action-btn.primary:hover {
    box-shadow: 0 10px 25px rgba(223, 122, 130, 0.5);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--color-text-secondary);
}

.action-btn.secondary:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* Bouquet Visualizer (Vase Container) */
.bouquet-visualizer-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    height: 400px;
    background: radial-gradient(circle at bottom, rgba(20, 15, 30, 0.5) 0%, rgba(5, 3, 10, 0) 75%);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 20px;
}

.glass-vase-wrapper {
    position: relative;
    width: 200px;
    height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.vase {
    position: relative;
    width: 90px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px 10px 40px 40px / 10px 10px 20px 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), inset 0 2px 5px rgba(255,255,255,0.2), inset 0 -5px 15px rgba(0,0,0,0.4);
    z-index: 5;
    overflow: hidden;
}

.vase-water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(to top, rgba(76, 201, 240, 0.12), rgba(76, 201, 240, 0.05));
    border-top: 1.5px solid rgba(76, 201, 240, 0.3);
}

.vase-ribbon {
    position: absolute;
    top: 15px;
    left: -8px;
    width: calc(100% + 16px);
    height: 18px;
    background: linear-gradient(135deg, #ffb5a7, #df7a82);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background 0.5s ease;
}

.vase-ribbon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: inherit;
    border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.vase-ribbon::before {
    content: '❤';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 8px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.bouquet-flowers-canvas {
    position: absolute;
    bottom: 95px; /* Sits slightly inside the neck of the vase */
    width: 250px;
    height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    z-index: 4;
}

.empty-state-text {
    position: absolute;
    width: 80%;
    top: 20%;
    left: 10%;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
    animation: opacityPulse 2s infinite ease-in-out;
}

@keyframes opacityPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Bouquet Flower Elements */
.bouquet-flower {
    position: absolute;
    bottom: 0;
    transform-origin: bottom center;
    animation: growIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes growIn {
    0% { transform: scale(0) rotate(var(--rot, 0deg)); }
    100% { transform: scale(1) rotate(var(--rot, 0deg)); }
}

.b-stem {
    width: 3px;
    height: var(--stem-h, 150px);
    background: linear-gradient(to top, #1b4332, #2d6a4f);
    border-radius: 2px;
}

.b-leaf {
    position: absolute;
    width: 14px;
    height: 8px;
    background: #40916c;
    border-radius: 0 7px 0 7px;
    bottom: 60px;
}

.b-leaf-l { left: -10px; transform: rotate(-30deg); }
.b-leaf-r { right: -10px; transform: scaleX(-1) rotate(-35deg); bottom: 80px; }

.b-blossom {
    position: absolute;
    top: -16px;
    left: -16px;
    width: 35px;
    height: 35px;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ==========================================================================
   LOVE LETTER SECTION
   ========================================================================== */
.envelope-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    perspective: 1200px;
}

.envelope-wrapper {
    position: relative;
    width: 550px;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/* Glassmorphic Envelope */
.envelope {
    position: relative;
    width: 100%;
    height: 350px;
    background: rgba(30, 20, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 2px 10px rgba(255,255,255,0.05);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.5s ease;
}

.envelope:hover {
    transform: translateY(-8px);
}

.envelope-front {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 274px solid transparent;
    border-right: 274px solid transparent;
    border-bottom: 175px solid rgba(255, 255, 255, 0.04);
    bottom: 0;
    left: 0;
    z-index: 12;
}

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9;
}

/* Inside shape */
.envelope::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 274px solid rgba(40, 30, 60, 0.2);
    border-right: 274px solid rgba(40, 30, 60, 0.2);
    border-bottom: 348px solid transparent;
    z-index: 9;
}

.envelope-top-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 274px solid transparent;
    border-right: 274px solid transparent;
    border-top: 178px solid rgba(45, 30, 65, 0.75);
    transform-origin: top center;
    transition: transform 0.6s ease;
    z-index: 14;
}

/* Folding animation */
.envelope-wrapper.open .envelope-top-flap {
    transform: rotateX(180deg);
    z-index: 8; /* behind the letter */
}

/* Heart seal */
.envelope-glowing-heart {
    position: absolute;
    top: calc(178px - 24px); /* centered at tip of flap */
    left: calc(50% - 24px);
    z-index: 15;
    transition: all 0.4s ease;
    filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.6));
}

.envelope-wrapper.open .envelope-glowing-heart {
    transform: translateY(140px) scale(0.6);
    opacity: 0;
    pointer-events: none;
}

/* Letter Content */
.letter {
    position: absolute;
    width: 490px;
    height: 330px;
    background: #fdfaf6;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 40px;
    color: #2b2520;
    transform: translateY(10px);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 8;
    overflow: hidden;
}

.envelope-wrapper.open .letter {
    transform: translateY(-200px);
    height: auto;
    min-height: 380px;
    z-index: 13;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.letter-inner {
    opacity: 0.1;
    transition: opacity 0.5s ease;
    transition-delay: 0.4s;
    display: flex;
    flex-direction: column;
}

.envelope-wrapper.open .letter-inner {
    opacity: 1;
}

.letter-salutation {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: #4a283d;
    margin-bottom: 20px;
}

.letter-body {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 24px;
    text-align: justify;
    color: #443c35;
    min-height: 120px;
}

.typewriter-text {
    white-space: pre-line;
    display: inline;
}

.letter-closing {
    font-size: 0.95rem;
    color: #88786a;
}

.letter-signature {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--color-accent-rose);
    line-height: 1;
    margin-top: 5px;
}

.love-burst-btn {
    align-self: flex-start;
    margin-top: 24px;
    background: var(--color-accent-rose);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.love-burst-btn:hover {
    background: #ff2d55;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.5);
}

.btn-stars {
    animation: floatIcon 1.5s infinite ease-in-out;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 60px 24px;
    text-align: center;
    z-index: 10;
    position: relative;
    background: rgba(10, 5, 20, 0.4);
}

.footer p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.footer-note {
    font-size: 0.8rem !important;
    color: var(--color-text-muted) !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
    .hero-title { font-size: 4rem; }
    .hero-title .highlight { font-size: 5rem; transform: translateY(10px); }
    
    .bouquet-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px;
    }
    .bouquet-visualizer-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .section { padding: 60px 16px; }
    h2 { font-size: 2.2rem; }
    
    .hero-title { font-size: 3.2rem; }
    .hero-title .highlight { font-size: 4rem; transform: translateY(8px); }
    .hero-subtitle { font-size: 1.1rem; }
    
    .canvas-wrapper { height: 400px; }
    
    .selector-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .envelope-wrapper {
        width: 100%;
        max-width: 400px;
        height: 280px;
    }
    .envelope {
        height: 260px;
    }
    .envelope-front {
        border-left-width: 199px;
        border-right-width: 199px;
        border-bottom-width: 130px;
    }
    .envelope::after {
        border-left-width: 199px;
        border-right-width: 199px;
    }
    .envelope-top-flap {
        border-left-width: 199px;
        border-right-width: 199px;
        border-top-width: 132px;
    }
    .envelope-glowing-heart {
        top: calc(132px - 20px);
        left: calc(50% - 20px);
    }
    .envelope-glowing-heart svg {
        width: 40px;
        height: 40px;
    }
    
    .letter {
        width: calc(100% - 30px);
        padding: 24px;
        font-size: 0.9rem;
    }
    .envelope-wrapper.open .letter {
        transform: translateY(-160px);
    }
    .letter-salutation { font-size: 1.3rem; }
    .letter-signature { font-size: 2rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.6rem; }
    .hero-title .highlight { font-size: 3.2rem; transform: translateY(6px); }
    .canvas-wrapper { height: 320px; }
    .palette-btn { padding: 6px 12px; font-size: 0.8rem; }
}

/* ==========================================================================
   WELCOME MODAL PANEL
   ========================================================================== */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 5, 14, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 2000;
}

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

.welcome-modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--glass-shadow), 0 0 30px rgba(255, 77, 109, 0.2);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.welcome-modal-overlay.active .welcome-modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close-btn:hover {
    color: var(--color-accent-rose);
}

.modal-flower-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: floatIcon 3s infinite ease-in-out;
}

.welcome-modal-content h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.welcome-modal-content p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-features {
    list-style: none;
    text-align: left;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.modal-features li span {
    font-size: 1.2rem;
}

.modal-features li strong {
    color: #fff;
}

.modal-start-btn {
    background: var(--rose-gold-gradient);
    border: none;
    color: #fff;
    padding: 12px 32px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(223, 122, 130, 0.3);
    transition: all 0.3s;
    width: 100%;
}

.modal-start-btn:hover {
    box-shadow: 0 8px 25px rgba(223, 122, 130, 0.5);
    transform: translateY(-2px);
}
