/* =========================================
   CSS VARIABLES (THEME: Apple Cupertino)
   ========================================= */
:root {
    /* Color Palette */
    --primary: #007AFF;
    --primary-rgb: 0, 122, 255;
    --primary-hover: #0062CC;
    --secondary: #5856D6;
    --secondary-rgb: 88, 86, 214;
    --accent: #34C759;
    --accent-rgb: 52, 199, 89;
    
    /* Backgrounds */
    --background: #F5F5F7;
    --background-alt: #E5E5EA;
    --surface: #FFFFFF;
    
    /* Text */
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --text-muted: #AEAEB2;
    
    /* UI Elements */
    --border: rgba(0, 0, 0, 0.1);
    --border-radius: 24px;
    
    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =========================================
   MANDATORY SECTION STYLING
   ========================================= */
*, *::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-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

section, .section, #playground, #how-to-use, #gallery, #testimonials, #faq, #features, #why-use {
    padding: 5rem 2rem;
    position: relative;
    width: 100%;
}

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

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

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

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

h1 { font-weight: 800; letter-spacing: -0.02em; }
h2 { font-weight: 700; }

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

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

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

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

.section-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

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

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

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(var(--primary-rgb), 0); }
}

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

.card:hover, .step-card:hover, .feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-glow:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.2);
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

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

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

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

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

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

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

/* =========================================
   HERO SECTION (Aurora Animation)
   ========================================= */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 5rem;
    position: relative;
    overflow: hidden;
}

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

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

/* Aurora Gradient Animation */
.hero-bg-animation {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(var(--primary-rgb), 0.4) 0%,
        rgba(var(--secondary-rgb), 0.4) 25%,
        rgba(var(--accent-rgb), 0.3) 50%,
        rgba(var(--secondary-rgb), 0.4) 75%,
        rgba(var(--primary-rgb), 0.4) 100%
    );
    background-size: 400% 400%;
    animation: aurora 20s ease infinite;
    z-index: 1;
    opacity: 0.6;
    mix-blend-mode: overlay;
}

@keyframes aurora {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

.playground-panel {
    border-radius: 24px;
    padding: 1.5rem;
}

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

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

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

.upload-placeholder svg, .result-placeholder svg {
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-text {
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.result-display {
    background: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.result-placeholder {
    color: var(--text-muted);
    text-align: center;
}

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

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

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

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

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

.hidden { display: none !important; }

/* =========================================
   HOW TO USE
   ========================================= */
.step-card {
    position: relative;
    text-align: left;
    padding-top: 4rem;
}

.step-number {
    position: absolute;
    top: 2rem;
    left: 2rem;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

/* =========================================
   FEATURES
   ========================================= */
.icon-wrapper {
    width: 56px;
    height: 56px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

/* =========================================
   GALLERY
   ========================================= */
.gallery-item {
    position: relative;
    height: 250px;
    overflow: hidden;
    padding: 0; /* Remove padding for full image */
    border: none;
}

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

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

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay span {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* =========================================
   TESTIMONIALS
   ========================================= */
.testimonial-card {
    text-align: left;
    position: relative;
}

.quote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

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

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

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

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

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

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

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

.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;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 500px; /* Approximate max height */
    padding-bottom: 1.5rem;
}

/* =========================================
   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 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column a {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

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

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .steps-grid, .gallery-grid, .testimonials-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    html { font-size: 15px; }
    
    .hero { padding-top: 6rem; }
    
    /* Navigation */
    .menu-toggle { display: block; }
    
    header nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        display: none;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    }
    
    header nav.active { display: flex; }
    
    /* Grids to Single Column */
    .playground-grid, .grid-3, .grid-2, .steps-grid, .gallery-grid, .testimonials-grid, .footer-content {
        grid-template-columns: 1fr;
    }
    
    .gallery-item { height: 300px; }
    
    .playground-actions { flex-direction: column; }
    
    .footer-content { gap: 2rem; text-align: center; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.5rem; }
    section { padding: 3rem 1.5rem; }
    
    .upload-zone, .result-display { height: 280px; }
}