/* =========================================
   CSS VARIABLES & RESET
   ========================================= */
:root {
    /* Color Palette */
    --primary: #f17b3e;
    --primary-rgb: 241, 123, 62;
    --primary-hover: #d9652b;
    --secondary: #267bbb;
    --accent: #f17b3e;
    --background: #FFFFFF;
    --background-alt: #F4F6F9;
    --surface: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --container-width: 1200px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--background);
    overflow-x: hidden;
}

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

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

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

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

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.hidden {
    display: none !important;
}

/* =========================================
   SECTION STYLING
   ========================================= */
section, .section {
    padding: 5rem 1.5rem;
    position: relative;
}

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 {
    font-size: clamp(2rem, 5vw, 2.5rem);
}

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

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

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

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

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

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

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

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

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

.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;
    /* Grid Scanner Animation */
    background: 
        linear-gradient(90deg, transparent 98%, rgba(241, 123, 62, 0.1) 100%),
        linear-gradient(0deg, transparent 98%, rgba(241, 123, 62, 0.1) 100%);
    background-size: 60px 60px;
    animation: gridMove 25s linear infinite;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 4s ease-in-out infinite;
    top: 0;
}

@keyframes gridMove { 
    to { background-position: 60px 60px; } 
}

@keyframes scan { 
    0%, 100% { top: 0; opacity: 0; } 
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; } 
}

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

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 900px;
}

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

.hero-description {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

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

/* =========================================
   FEATURES GRID
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(241, 123, 62, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* =========================================
   PLAYGROUND
   ========================================= */
.playground-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.playground-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.playground-panel h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

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

.upload-zone {
    border: 2px dashed var(--secondary);
    background: rgba(38, 123, 187, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    background: rgba(38, 123, 187, 0.1);
    border-color: var(--primary);
}

.upload-zone.dragover {
    background: rgba(241, 123, 62, 0.1);
    border-color: var(--primary);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--primary);
    background-color: var(--surface);
}

.upload-placeholder {
    text-align: center;
    pointer-events: none;
}

.upload-placeholder svg {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

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

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

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

#preview-image, #result-image, #result-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.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;
}

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

.step-card {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 10px rgba(56, 18, 193, 0.3);
}

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

.gallery-item {
    position: relative;
    border-radius: 0; /* Zero border radius as per guidelines */
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay span {
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

/* =========================================
   TESTIMONIALS
   ========================================= */
.testimonials-grid {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
}

.testimonial-card {
    min-width: 300px;
    flex: 1;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

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

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

.testimonial-author span {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 500;
}

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

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

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

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.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;
    border-left: 3px solid var(--primary);
    margin-left: 1.5rem;
}

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

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

.footer-brand h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-column ul {
    list-style: none;
}

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

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

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

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

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
/* Tablet */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .playground-grid {
        grid-template-columns: 1fr;
    }
    .upload-zone, .result-display {
        height: 300px;
    }
}

/* Mobile */
@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: 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        align-items: stretch;
    }
    header nav.active { display: flex; }
    header nav a { padding: 0.5rem 0; border-bottom: 1px solid var(--background-alt); }
    #header-cta { margin-top: 1rem; text-align: center; }

    /* Hero */
    .hero { padding-top: 6rem; padding-bottom: 3rem; text-align: center; }
    .hero h1 { font-size: 2.5rem; }
    
    /* Grids */
    .steps-grid, .gallery-grid, .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .testimonials-grid {
        flex-direction: column;
        overflow: visible;
    }
    
    /* Spacing */
    section { padding: 3rem 1.5rem; }
}