/* =========================================
   CSS Custom Properties & Color Palette 
   Theme: The Sunlit Garden (Sage Green & Yellow)
========================================= */
:root {
    /* Color Palette */
    --sage-green-dark: #4b6a53;
    --sage-green: #7a9c81;
    --sage-green-light: #a7c4ac;
    --sunlight-yellow: #fcd581;
    --sunlight-light: #fff5d6;
    --cream: #f4ecdf;
    --forest-wood: #2c3e30;
    --text-dark: #3a473c;
    --text-light: #5e7362;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(75, 106, 83, 0.15);
    
    /* Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-script: 'Lora', serif;
    --font-body: 'Inter', sans-serif;
}

/* =========================================
   Reset & Basics
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--cream);
    /* Animated Gradient Background */
    background: linear-gradient(135deg, var(--cream) 0%, var(--sage-green-light) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

/* Background canvas for particles */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 6rem;
    position: relative;
    z-index: 1;
}

/* =========================================
   Glassmorphism Utility
========================================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 40px;
}

/* Typography Utilities */
h1, h2, h3, .title, .section-title {
    font-family: var(--font-heading);
    color: var(--forest-wood);
}
p {
    line-height: 1.6;
    color: var(--text-dark);
}

/* Image Placeholder Style */
.placeholder-img {
    object-fit: cover;
    background-color: var(--sage-green-light);
    border: 3px solid var(--sunlight-light);
}

/* =========================================
   Hero Section
========================================= */
.hero {
    margin-top: 5vh;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: floatUp 1.5s ease-out forwards;
}

.hero-image-container {
    margin-bottom: 30px;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(75, 106, 83, 0.3);
    border: 4px solid #fff;
    transition: transform 0.5s ease;
}

.avatar:hover {
    transform: scale(1.05) rotate(5deg);
}

.hero-text {
    margin-bottom: 40px;
}

.subtitle {
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sage-green);
    margin-bottom: 10px;
    font-family: var(--font-body);
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--forest-wood);
}

.name {
    font-size: 2.2rem;
    font-family: var(--font-script);
    font-style: italic;
    color: var(--sage-green-dark);
    margin-bottom: 5px;
}

.nickname {
    font-size: 1.5rem;
    font-family: var(--font-script);
    color: var(--forest-wood);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.date {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    background: rgba(255,255,255,0.6);
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    animation: bounce 2s infinite;
    color: var(--sage-green-dark);
    font-weight: 500;
}

.arrow {
    font-size: 1.5rem;
    margin-top: 5px;
}

/* =========================================
   General Section Styles
========================================= */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 50px;
    font-family: var(--font-script);
    font-size: 1.2rem;
    color: var(--sage-green-dark);
    font-style: italic;
}

/* =========================================
   Timeline Section
========================================= */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* The vertical line */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--sage-green-light);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 4px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    margin-bottom: 40px;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--sunlight-yellow);
    border: 4px solid var(--white, #fff);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 10px rgba(252, 213, 129, 0.8);
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    padding: 25px;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.memory-img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
}

.memory-date {
    font-size: 0.9rem;
    color: var(--sage-green-dark);
    font-weight: 600;
    margin-bottom: 10px;
}

/* =========================================
   18 Reasons Grid
========================================= */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.reason-card {
    perspective: 1000px;
    height: 180px;
    cursor: pointer;
}

.reason-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.reason-card.flipped .reason-inner {
    transform: rotateY(180deg);
}

.reason-front, .reason-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.reason-front {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--forest-wood);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: bold;
}

.reason-front span {
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: normal;
    color: var(--sage-green-dark);
    margin-top: 5px;
}

.reason-back {
    background: var(--sage-green);
    color: #fff;
    transform: rotateY(180deg);
    font-size: 0.95rem;
    line-height: 1.4;
    border: 1px solid rgba(255,255,255,0.2);
}

/* =========================================
   Secret Letter Section
========================================= */
.letter-section {
    margin-bottom: 60px;
}

.letter {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 50px 60px;
    background: linear-gradient(to bottom right, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    border-radius: 4px 32px 4px 32px; /* Slightly asymmetrical like paper */
}

.css-stamp {
    position: absolute;
    top: -20px;
    right: 30px;
    width: 70px;
    height: 70px;
    background-color: var(--sage-green-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.15), inset 0 0 8px rgba(0,0,0,0.4);
    border: 2px solid var(--sage-green);
    transform: rotate(15deg);
    z-index: 10;
}

.stamp-inner-circle {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1.5px dashed var(--sunlight-yellow);
    border-radius: 50%;
}

.stamp-petals {
    font-size: 28px;
    color: var(--sunlight-light);
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

a.css-stamp {
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a.css-stamp:hover {
    transform: rotate(15deg) scale(1.15);
    box-shadow: 2px 6px 18px rgba(0,0,0,0.25), inset 0 0 8px rgba(0,0,0,0.4);
}

.letter-greeting {
    font-family: var(--font-script);
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--sage-green-dark);
}

.letter-body p {
    margin-bottom: 15px;
    font-family: var(--font-script);
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.8;
}

.letter-signoff {
    margin-top: 40px;
    text-align: left;
    font-family: var(--font-script);
}

.signature {
    font-family: 'Great Vibes', cursive, var(--font-script);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--sage-green);
    display: block;
    margin-top: 10px;
}

/* =========================================
   Footer
========================================= */
footer {
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
    color: var(--sage-green-dark);
}

/* =========================================
   Animations & Reveals
========================================= */
@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s ease-out;
}

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

/* =========================================
   Floral Decorations
========================================= */
.decoration {
    position: absolute;
    font-size: 3rem;
    color: var(--sage-green-dark);
    opacity: 0.15;
    z-index: -1; /* Behind glass panels but above background */
    pointer-events: none;
    animation: sway 4s ease-in-out infinite alternate;
}
.decoration.yellow {
    color: var(--sunlight-yellow);
    opacity: 0.3;
}
.decoration-1 { top: 8%; left: 3%; font-size: 4rem; animation-delay: 0s; }
.decoration-2 { top: 25%; right: 5%; transform: rotate(15deg); animation-delay: 1s; font-size: 3.5rem; }
.decoration-3 { top: 55%; left: -2%; font-size: 5rem; animation-delay: 2s; }
.decoration-4 { top: 75%; right: 2%; font-size: 4rem; animation-delay: 0.5s; }
.decoration-5 { top: 92%; left: 8%; transform: rotate(-10deg); animation-delay: 1.5s; font-size: 4.5rem; }

@keyframes sway {
    from { transform: rotate(-8deg) translateY(0); }
    to { transform: rotate(8deg) translateY(-15px); }
}

/* =========================================
   Responsive Design (Mobile First adjustments built-in, now scaling down for very small screens)
========================================= */

/* Tablets & Small Desktops */
@media screen and (max-width: 850px) {
    .container {
        gap: 4rem;
    }
    
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 0;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 21px; /* Align with line */
    }
}

/* Mobile Phones */
@media screen and (max-width: 600px) {
    .title {
        font-size: 2.5rem;
    }
    
    .name {
        font-size: 1.8rem;
    }
    
    .glass-panel {
        padding: 25px;
    }
    
    .letter {
        padding: 40px 25px;
    }
    
    .css-stamp {
        top: -15px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .stamp-inner-circle {
        width: 40px;
        height: 40px;
    }
    
    .stamp-petals {
        font-size: 22px;
    }
    
    .reasons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
