/* =========================================
   CSS VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Generated Theme 486 Colors */
    --primary: #231b6f;
    --primary-rgb: 12, 159, 214;
    --primary-hover: #7a78c9;
    
    --secondary: #231b6f;
    --secondary-rgb: 114, 65, 86;
    
    --accent: #8e4b15;
    --accent-rgb: 142, 75, 21;
    
    --background: #FFFFFF;
    --background-alt: #F5F7FA;
    --surface: #FFFFFF;
    
    --text: #000000;
    --text-secondary: #4A4A4A;
    --text-muted: #888888;
    
    --border: #E5E7EB;
    
    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 1rem;
    word-break: break-word;
}

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

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s ease;
}

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

ul {
    list-style: none;
}

/* =========================================
   SECTION STYLING - MANDATORY
   ========================================= */
section, .section, #playground, #how-to-use, #gallery, #testimonials, #faq {
    padding: 5rem 2rem;
    position: relative;
}

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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.section-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* =========================================
   COMPONENTS
   ========================================= */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
}

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

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.05);
    transform: translateY(-2px);
}

/* Cards */
.card, .feature-card, .step-card, .testimonial-card, .gallery-card, .playground-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* =========================================
   HEADER
   ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.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(--text);
}

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

header nav a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
}

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

#header-cta {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
}

#header-cta:hover {
    background: var(--primary-hover);
    color: white;
}

.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;
    justify-content: center;
    padding-top: 6rem;
    color: white;
    text-align: center;
}

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

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

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

/* Floating Particles / Nodes Animation */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%; /* Lab aesthetic: small dots/nodes */
    opacity: 0;
    animation: floatParticle 12s ease-in-out infinite;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(-20vh) scale(1.5); opacity: 0; }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    /* Lab aesthetic usually white/clean, so using white overlay instead of dark */
}

/* Override hero text for light background */
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================
   FEATURES SECTION
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.feature-image {
    height: 200px;
    overflow: hidden;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.feature-card:hover .feature-image img {
    transform: scale(1.05);
}

.feature-content {
    padding: 2rem;
}

.feature-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

/* =========================================
   PLAYGROUND SECTION (Functional)
   ========================================= */
#playground {
    background-color: var(--background);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.playground-panel {
    background: var(--background-alt);
    border: 1px solid var(--border);
    padding: 2rem;
}

.panel-header h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Zone */
.upload-zone {
    height: 350px;
    min-height: 300px;
    background: var(--surface);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.upload-placeholder {
    text-align: center;
    padding: 2rem;
}

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

.upload-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    background: var(--surface);
}

/* Result Display */
.result-display {
    height: 350px;
    min-height: 300px;
    background: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.result-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.5);
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

#result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: 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;
}

.hidden {
    display: none !important;
}

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

.step-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--surface);
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}

.step-card h3 {
    margin-bottom: 1rem;
}

/* =========================================
   GALLERY (USE CASES)
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.gallery-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    border: none;
}

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

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay h3 {
    color: white;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-overlay p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.gallery-card:hover .gallery-overlay h3,
.gallery-card:hover .gallery-overlay p {
    transform: translateY(0);
}

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

.testimonial-card {
    background: var(--surface);
    padding: 2.5rem;
    position: relative;
}

.testimonial-quote {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: -10px;
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.15;
    font-family: serif;
    z-index: -1;
}

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

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

.avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.testimonial-info h4 {
    font-size: 1rem;
    margin: 0;
}

.testimonial-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

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

.faq-question:hover {
    background: var(--background-alt);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    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 2rem 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 300px;
}

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

.footer-column ul li a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

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

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .steps-grid, .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Header */
    .menu-toggle {
        display: block;
    }
    
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    header nav.active {
        display: flex;
    }
    
    /* Hero */
    .hero {
        padding-top: 5rem;
        padding-bottom: 3rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    /* Playground */
    .playground-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Grids */
    .steps-grid, .gallery-grid, .testimonials-grid, .footer-content {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    /* Footer */
    .footer-content {
        gap: 2rem;
    }
}