/* =========================================
   VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Palette: Void Precinct Protocol */
    --primary: #8BC34A;
    --primary-rgb: 139, 195, 74;
    --secondary: #4A148C;
    --secondary-rgb: 74, 20, 140;
    --accent: #00FF41; /* Slime Green */
    --accent-rgb: 0, 255, 65;
    
    --background: #0A0A0A; /* Deep Black Void */
    --background-alt: #121212; /* Slightly Lighter Surface */
    --surface: #1A1A1A; /* Panel Background */
    
    --text: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #404040;
    
    --border: #333333;
    
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;
    
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* =========================================
   SECTION STYLING - MANDATORY
   ========================================= */
section, .section, #playground, #how-to-use, #gallery, #testimonials, #faqs {
    padding: 5rem 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border); /* Section dividers */
}

section:nth-child(odd) {
    background-color: var(--background);
}
section:nth-child(even) {
    background-color: var(--background-alt);
    background-image: radial-gradient(circle, #222 1px, transparent 1px);
    background-size: 20px 20px; /* Dot pattern */
}

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

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

/* Underline effect for headers */
.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 1rem auto 0;
}

.section-header p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(0, 255, 65, 0.2); /* Slime green border */
    backdrop-filter: blur(10px);
    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);
    letter-spacing: 2px;
}

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

header nav a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
}

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

/* Active link indicator */
header nav a:not(.btn)::before {
    content: '>';
    position: absolute;
    left: -15px;
    opacity: 0;
    color: var(--accent);
    transition: opacity 0.3s ease;
}
header nav a:hover::before {
    opacity: 1;
}

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

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0; /* Sharp corners */
}

.btn-primary {
    background: var(--accent);
    color: #000; /* High contrast black on green */
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: #33FF66;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.6);
    transform: translateY(-2px);
}

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

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

.btn-secondary:hover {
    border-color: var(--text);
    color: var(--text);
}

.btn-nav {
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-nav:hover {
    background: var(--accent);
    color: #000;
}

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

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

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4; /* Darkened for text readability */
}

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

/* Matrix Rain column */
.matrix-column {
    position: absolute;
    color: var(--accent);
    font-family: monospace;
    font-size: 16px;
    writing-mode: vertical-rl;
    animation: matrixFall linear infinite;
    opacity: 0.6;
    text-shadow: 0 0 5px var(--accent);
}

@keyframes matrixFall {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(circle at center, transparent 0%, var(--background) 90%);
}

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

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    border: 2px solid var(--accent); /* Framed like a stamp */
    padding: 1rem 2rem;
    display: inline-block;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--text);
    font-family: var(--font-heading);
}

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

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    position: relative;
}

.panel-header {
    display: flex;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.green {
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent);
}

.upload-zone, .result-display {
    width: 100%;
    height: 350px;
    min-height: 300px;
    max-height: 400px;
    background: #000;
    border: 1px dashed var(--border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(0, 255, 65, 0.05);
}

.upload-content, .placeholder-content {
    text-align: center;
    color: var(--text-muted);
}

.upload-content i, .placeholder-content i {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.upload-content p, .placeholder-content p {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.upload-zone img, .result-display img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

/* Scanning effect */
#loading-state {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scanner-line {
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: scan 1.5s ease-in-out infinite;
    position: absolute;
    top: 0;
}

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

.processing-text {
    font-family: var(--font-heading);
    color: var(--accent);
    margin-top: 1rem;
    animation: blink 0.5s step-end infinite alternate;
}

@keyframes blink { 50% { opacity: 0; } }

.controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Hidden utility */
.hidden { display: none !important; }

/* =========================================
   HOW TO USE (STEPS)
   ========================================= */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    position: relative;
    transition: transform 0.3s ease;
}

.step-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.step-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.05);
    position: absolute;
    top: 0;
    right: 1rem;
    line-height: 1;
}

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

.step-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

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

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    background: #000;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: grayscale(100%) contrast(1.2); /* Noir look */
}

.gallery-item:hover img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top: 1px solid var(--accent);
}

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

.gallery-overlay span {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 0.9rem;
}

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

.testimonial-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--border);
    transition: background 0.3s ease;
}

.testimonial-card:hover::before {
    background: var(--accent);
}

.quote-icon {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.review-text {
    margin-bottom: 1.5rem;
    font-style: italic;
}

.reviewer-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

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

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

.accordion-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.accordion-header {
    width: 100%;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.accordion-header:hover {
    background: rgba(255,255,255,0.05);
}

.accordion-header i {
    transition: transform 0.3s ease;
    color: var(--accent);
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.25rem;
}

.accordion-content p {
    padding: 1rem 0 1.5rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

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

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

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

.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    font-family: var(--font-heading);
}

/* =========================================
   MODALS
   ========================================= */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--background);
    border: 1px solid var(--accent);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--accent);
}

.modal-body h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.modal-body h4 {
    margin: 1.5rem 0 0.5rem;
    color: var(--text);
    font-family: var(--font-heading);
}

.modal-body ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-body li {
    margin-bottom: 0.5rem;
}

/* =========================================
   MEDIA QUERIES (MANDATORY)
   ========================================= */

/* Mobile (max 767px) */
@media (max-width: 767px) {
    html { font-size: 14px; }
    
    header { padding: 0.75rem 1rem; }
    
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background);
        border-bottom: 1px solid var(--accent);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    header nav.active { display: flex; }
    .menu-toggle { display: block; }
    
    .hero {
        padding: 6rem 1rem 3rem;
        min-height: 100vh;
    }
    
    .playground-grid { grid-template-columns: 1fr; }
    
    /* Order change on mobile: result below upload */
    .result-panel { margin-top: 1rem; }
    
    .upload-zone, .result-display { height: 300px; }
    
    .steps-grid, .gallery-grid, .testimonials-grid { grid-template-columns: 1fr; }
    
    .desktop-only { display: none; }
    .mobile-only { display: inline-block; }
}

/* Tablet (min 768px) */
@media (min-width: 768px) {
    html { font-size: 15px; }
    
    .playground-grid { 
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .mobile-only { display: none; }
    .desktop-only { display: inline-block; }
}

/* Desktop (min 1024px) */
@media (min-width: 1024px) {
    html { font-size: 16px; }
    
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    
    .container { padding: 0 2rem; }
}