/* =========================================
   CSS VARIABLES & RESET
   ========================================= */
:root {
    /* Color Palette - Generated Theme 870 */
    --primary: #5e812d;
    --primary-rgb: 94, 129, 45;
    --primary-hover: #4a6523;
    
    --secondary: #2077b6;
    --secondary-rgb: 32, 119, 182;
    
    --accent: #289d44;
    --accent-rgb: 40, 157, 68;
    
    --background: #FFFFFF;
    --background-alt: #F2F7ED;
    --surface: #FFFFFF;
    
    --text: #000000;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    
    --border: #e4e4e7;
    
    /* Typography */
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Nunito', sans-serif;
    
    /* Spacing */
    --border-radius: 24px;
    --container-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    word-break: break-word;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* =========================================
   LAYOUT & CONTAINERS
   ========================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

section:nth-child(odd) { background-color: var(--background); }
section:nth-child(even) { background-color: var(--background-alt); }

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.section-header h2 { margin-bottom: 1rem; }
.section-header p { font-size: 1.1rem; }

/* =========================================
   COMPONENTS
   ========================================= */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #1a6296;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(var(--secondary-rgb), 0.3);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    background-color: rgba(0,0,0,0.05);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* Cards */
.card, .step-card, .testimonial-card, .playground-panel {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.card:hover, .step-card:hover, .testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.15);
}

/* =========================================
   HEADER
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

nav a:hover { color: var(--primary); }

nav .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding-top: 5rem; /* Header offset */
}

.hero-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-bg-animation {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Floating Particles Animation (Notes/Bubbles) */
.particle {
    position: absolute;
    opacity: 0;
    animation: floatUp linear infinite;
    color: var(--primary);
}

.particle.bubble {
    border-radius: 50%;
    background-color: var(--secondary);
    opacity: 0.6;
}

.particle.note {
    font-size: 24px;
    font-family: Arial, sans-serif;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translateY(-10vh) scale(1.2) rotate(360deg);
        opacity: 0;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
}

.hero-text {
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* =========================================
   PLAYGROUND SECTION
   ========================================= */
.playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.panel-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.upload-zone, .result-display {
    width: 100%;
    height: 350px;
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-zone {
    background-color: var(--background-alt);
    border: 2px dashed rgba(var(--primary-rgb), 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.05);
}

.result-display {
    background-color: #000;
    border: 1px solid var(--border);
}

.upload-placeholder, .result-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    z-index: 1;
}

.result-placeholder { color: #888; }

.upload-icon, .result-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--primary);
}

.result-icon { color: #555; }

.upload-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

#preview-image, #result-image, #result-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

.hidden { display: none !important; }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.playground-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.playground-actions .btn { flex: 1; }

/* =========================================
   HOW IT WORKS (STEPS)
   ========================================= */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
}

.step-card {
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: rgb(94, 129, 45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
}

/* =========================================
   GALLERY
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    /* Polaroid scatter effect simulation */
    background: white;
    padding: 0.5rem;
}

.gallery-item:nth-child(odd) { transform: rotate(2deg); }
.gallery-item:nth-child(even) { transform: rotate(-2deg); }

.gallery-item:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-overlay i {
    font-size: 3rem;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* =========================================
   TESTIMONIALS
   ========================================= */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.testimonial-card {
    position: relative;
}

.testimonial-card::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 40px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: var(--surface) transparent;
    /* Speech bubble effect */
}

.testimonial-content {
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.author-name {
    font-weight: 700;
    color: var(--text);
}

.author-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =========================================
   FAQ
   ========================================= */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-question:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.faq-icon {
    color: var(--primary);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    color: var(--text-secondary);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   ANIMATIONS & UTILS
   ========================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    /* Removed .testimonials-grid override to keep 3 columns and avoid orphans */
}

@media (max-width: 768px) {
    /* Header */
    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        align-items: stretch;
        text-align: center;
    }
    
    nav.active { display: flex; }
    .menu-toggle { display: block; }
    
    /* Hero */
    .hero {
        padding-top: 5rem;
        padding-bottom: 3rem;
        min-height: auto;
    }
    
    .hero-bg-image { position: relative; height: 300px; }
    .hero-overlay { display: none; }
    .hero-content { flex-direction: column; }
    .hero-text { text-align: center; margin-top: 0; }
    
    /* Grids */
    .playground-grid, .steps-grid, .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    h1 { font-size: 2.5rem; }
    
    /* Gallery items reset rotation on mobile */
    .gallery-item:nth-child(odd), .gallery-item:nth-child(even) {
        transform: none;
    }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; }
    .btn { width: 100%; }
}