/* =========================================
   VARIABLES & THEME
   ========================================= */
:root {
    /* Color Palette */
    --primary: #00FF41;      /* Neon Green */
    --secondary: #0D0D0D;    /* Dark Grey */
    --background: #000000;   /* Deep Black */
    --background-alt: #050505; 
    --surface: #111111;      /* Surface/Card */
    --text: #E5E5E5;         /* Light Grey */
    --text-secondary: #00FF41; /* Green Text */
    --text-muted: #666666;
    --border: #333333;
    
    /* Typography */
    --font-heading: 'Chakra Petch', sans-serif;
    --font-body: 'Space Mono', monospace;
    
    /* Effects */
    --glow: 0 0 10px rgba(0, 255, 65, 0.3);
}

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

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

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

/* Selection Style */
::selection {
    background: var(--primary);
    color: var(--background);
}

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

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

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

ul {
    list-style: none;
}

/* =========================================
   VISUAL FX (SCANLINES & VIGNETTE)
   ========================================= */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
    opacity: 0.6;
}

.vignette {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 998;
}

.blink {
    animation: blink-animation 1s steps(2, start) infinite;
}

@keyframes blink-animation {
    to { visibility: hidden; }
}

/* =========================================
   COMPONENTS
   ========================================= */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--background);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
}

.btn-secondary, .btn-outline {
    background: transparent;
    color: var(--primary);
}

.btn-secondary:hover, .btn-outline:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    box-shadow: none;
}

.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);
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 1.1rem;
}

/* =========================================
   HEADER
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

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

.logo-icon {
    margin-right: 0.5rem;
}

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

header nav a {
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

header nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary);
}

header nav .btn {
    margin-left: 1rem;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 8rem 2rem 4rem;
    background-color: var(--background);
}

.hero-bg-animation {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: 
        linear-gradient(90deg, rgba(0,255,65,0.03) 1px, transparent 1px),
        linear-gradient(rgba(0,255,65,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    perspective: 1000px;
    transform-style: preserve-3d;
    animation: grid-scroll 20s linear infinite;
    pointer-events: none;
}

@keyframes grid-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    background: rgba(0,0,0,0.6);
    padding: 2rem;
    border: 1px solid rgba(0,255,65,0.2);
    backdrop-filter: blur(4px);
}

.system-status {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--text);
    text-shadow: 2px 2px 0px var(--primary);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text);
}

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

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

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

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

.panel-header {
    color: var(--primary);
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
}

.upload-zone, .result-display {
    flex-grow: 1;
    min-height: 400px;
    max-height: 500px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: rgba(0,255,65,0.02);
    transition: all 0.3s;
}

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

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

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

.file-types {
    display: block;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-container, .result-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

.btn-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    border: 1px solid var(--primary);
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.btn-block {
    width: 100%;
}

/* Loader */
.loader {
    text-align: center;
    color: var(--primary);
}

.scanner-bar {
    width: 200px;
    height: 4px;
    background: var(--border);
    margin: 0 auto 1rem;
    position: relative;
    overflow: hidden;
}

.scanner-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; height: 100%; width: 30%;
    background: var(--primary);
    animation: scan-loading 1.5s ease-in-out infinite;
}

@keyframes scan-loading {
    0% { left: -30%; }
    100% { left: 100%; }
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
}

.lock-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* =========================================
   SECTIONS: HOW TO, GALLERY, TESTIMONIALS
   ========================================= */
section {
    padding: 5rem 1rem;
}

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

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

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.3s;
}

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

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

.step-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

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

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

.gallery-frame {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%);
    transition: filter 0.3s;
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.8);
    padding: 0.5rem;
    text-align: center;
    color: var(--primary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    border-top: 1px solid var(--primary);
}

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

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

.quote-icon {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.2;
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: serif;
}

.quote {
    margin-bottom: 1.5rem;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.author {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.author .name {
    display: block;
    color: var(--primary);
    font-weight: 700;
}

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

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

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

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

.faq-question:hover {
    color: var(--primary);
}

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

.faq-answer p {
    padding: 1rem 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.faq-item.active .faq-question {
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.faq-item.active .faq-answer {
    max-height: 300px; /* Approximate max height */
}

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

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

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

.footer-brand .logo {
    margin-bottom: 0.5rem;
    display: block;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

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

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

.separator {
    color: var(--border);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* =========================================
   MODALS
   ========================================= */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--background);
    border: 1px solid var(--primary);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.modal-body h2 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.modal-body h4 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
}

.modal-body ul {
    list-style: square;
    margin-left: 1.5rem;
    color: var(--text-muted);
}

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

/* =========================================
   RESPONSIVE (MEDIA QUERIES)
   ========================================= */

/* Tablet & Up */
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    
    header nav { display: block; position: static; background: none; box-shadow: none; }
    header nav ul { flex-direction: row; }
    
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    
    .hero { padding-top: 6rem; }
}

/* Mobile & Tablet Down */
@media (max-width: 1024px) {
    .testimonials-grid, .steps-grid, .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Only */
@media (max-width: 767px) {
    /* Fonts */
    html { font-size: 14px; }
    
    /* Navigation */
    .menu-toggle {
        display: block;
        background: none;
        border: 1px solid var(--primary);
        color: var(--primary);
        font-size: 1.5rem;
        padding: 0.25rem 0.5rem;
        cursor: pointer;
    }
    
    header { padding: 0.5rem 1rem; height: 60px; }
    
    header nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--background);
        border-bottom: 1px solid var(--primary);
        flex-direction: column;
        padding: 1rem;
        height: auto;
    }
    
    header nav.active { display: flex; }
    header nav ul { flex-direction: column; width: 100%; gap: 0; }
    header nav li { width: 100%; border-bottom: 1px solid var(--border); }
    header nav a { display: block; padding: 1rem 0; width: 100%; }
    header nav .btn { margin: 1rem 0 0; width: 100%; display: block; }
    
    /* Hero */
    .hero { min-height: 100dvh; padding: 6rem 1rem 2rem; }
    .hero h1 { font-size: 2rem; }
    
    /* Playground */
    .playground-grid { grid-template-columns: 1fr; gap: 1rem; }
    .playground-panel { min-height: auto; }
    .upload-zone, .result-display { min-height: 300px; height: 300px; }
    
    /* Grids */
    .steps-grid, .gallery-grid, .testimonials-grid { grid-template-columns: 1fr; }
    
    /* Sections */
    section { padding: 3rem 1rem; }
    .section-header { margin-bottom: 2rem; }
    
    /* Modal */
    .modal-content { height: 100%; max-height: 100%; border: none; }
}