@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;700&family=Fraunces:opsz,ital,wght@9..144,0,300;9..144,0,700;9..144,1,400&display=swap');

/* --- Variable Definitions --- */
:root {
    --primary-emerald: #064e3b;   /* Deep Nurturing Green */
    --accent-gold: #b45309;      /* Warm Earthy Gold */
    --sand-bg: #fdfbf7;          /* Soft Off-White/Sand */
    --text-main: #171717;
    --text-muted: #525252;
    --white: #ffffff;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--sand-bg);
    color: var(--text-main);
    line-height: 1.6;
    scroll-behavior: smooth;
}

h1, h2, h3, .serif {
    font-family: 'Fraunces', serif;
    color: var(--primary-emerald);
}

/* --- Hero Section Styling --- */
header {
    background-color: #000; /* Backdrop for image opacity */
}

header h1 {
    letter-spacing: -0.03em;
}

/* --- History & Timeline --- */
#history h2 span {
    background-color: var(--accent-gold) !important; /* Overriding your inline rose */
}

#timeline-container {
    border-color: #e5e5e5;
}

.timeline-item {
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: var(--accent-gold);
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--accent-gold);
}

/* --- Feature Grids --- */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-5px);
}

/* --- A Day at Bright Future --- */
.routine-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid #f1f1f1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.routine-card:hover {
    background: var(--primary-emerald);
    color: var(--white) !important;
}

.routine-card:hover i, 
.routine-card:hover p {
    color: var(--white) !important;
}

/* --- Transparency & Budget Bars --- */
#transparency {
    background-color: var(--white);
}

#transparency h2 {
    color: var(--primary-emerald) !important; /* Fixes your rose-600 inline class */
}

.progress-container {
    background: #e5e7eb;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-emerald);
    border-radius: 5px;
    transition: width 1s ease-in-out;
}

/* --- Impact Section --- */
#impact p {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    column-count: 1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.impact-card {
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    height: 400px;
    cursor: pointer;
}

.impact-card img {
    transition: transform 0.8s ease;
}

.impact-card:hover img {
    transform: scale(1.1);
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--primary-emerald);
    color: var(--white);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header h1 {
        font-size: 3.5rem;
    }
    
    #impact p {
        text-align: left;
        padding: 0 1rem;
    }
}

/* Foundation Gallery Grid */
.foundation-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 250px; /* Base height for rows */
    grid-auto-flow: dense; /* Fills in gaps automatically */
    gap: 20px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 1.5rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

/* Feature Classes for Variety */
.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

/* Hover Effects */
.gallery-item:hover {
    transform: scale(0.98);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Mobile Fix */
@media (max-width: 768px) {
    .gallery-item.wide, .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    .foundation-gallery {
        grid-template-columns: 1fr;
    }
}

/* Form Input Enhancements */
input::placeholder, 
textarea::placeholder {
    color: #a3a3a3;
    font-size: 0.9rem;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23064e3b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.5rem center;
    background-size: 1.2rem;
}

/* Form container hover effect */
#contact .bg-white {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#contact .bg-white:hover {
    box-shadow: 0 30px 60px rgba(6, 78, 59, 0.08);
}




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

.animate-spin {
    animation: spin 1s linear infinite;
}

#successMessage {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered entry for gallery */
.gallery-item {
    animation: fadeInUp 0.8s ease backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

/* Budget bars animation */
@keyframes growRight {
    from { width: 0; }
    to { width: var(--final-width, 100%); }
}

.progress-bar {
    animation: growRight 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Sticky CTA & Back to Top --- */
.sticky-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 50;
}

.btn-circle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-donate-sticky {
    background-color: var(--accent-gold);
    color: var(--white);
}

.btn-back-to-top {
    background-color: var(--primary-emerald);
    color: var(--white);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-circle:hover {
    transform: scale(1.1) translateY(-5px);
}

/* --- FAQ Accordion --- */
.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.faq-trigger {
    width: 100%;
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-emerald);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-content {
    max-height: 200px;
    padding-bottom: 1.5rem;
}

.faq-item.active i {
    transform: rotate(180deg);
}

.faq-trigger i {
    transition: transform 0.3s ease;
}

/* --- Testimonials --- */
.testimonial-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2rem;
    border: 1px solid #f1f1f1;
    position: relative;
}

.testimonial-card::before {
    content: '“';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 5rem;
    color: var(--primary-emerald);
    opacity: 0.1;
    font-family: 'Fraunces', serif;
}

/* --- Footer Refinement --- */
.footer-link {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-emerald);
}

.newsletter-input {
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    width: 100%;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--primary-emerald);
}