/* =========================================
   THEME: VELOCITY TERMINAL
   ========================================= */
:root {
    /* Color Palette */
    --primary: #D946EF;
    --primary-rgb: 217, 70, 239;
    --primary-hover: #E879F9;
    
    --secondary: #2DD4BF;
    --secondary-rgb: 45, 212, 191;
    
    --accent: #F472B6;
    --accent-rgb: 244, 114, 182;
    
    --background: #09090B;
    --background-alt: #121215;
    
    --surface: #18181B;
    --border: #27272A;
    
    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    
    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    /* Spacing */
    --section-padding: 5rem 2rem;
    --card-padding: 2rem;
}

/* =========================================
   MANDATORY SECTION STYLING
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

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

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

section {
    padding: var(--section-padding);
    position: relative;
    overflow: hidden;
}

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

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

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

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

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

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

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

/* =========================================
   HEADER & NAV
   ========================================= */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(217, 70, 239, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-code);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

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

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

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

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

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

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

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

/* Grid Scanner Animation */
.hero-bg-animation {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: 
        linear-gradient(90deg, transparent 98%, rgba(217, 70, 239, 0.15) 100%),
        linear-gradient(0deg, transparent 98%, rgba(217, 70, 239, 0.15) 100%);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(20deg);
    transform-origin: center bottom;
    animation: gridMove 20s linear infinite;
}

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

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

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

.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;
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(217, 70, 239, 0.3);
    letter-spacing: -0.03em;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--text-secondary);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 2px;
    font-weight: 600;
    font-family: var(--font-code);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 30px rgba(217, 70, 239, 0.5);
    transform: translateY(-2px);
    color: white;
}

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

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

.btn-secondary:hover {
    background: rgba(45, 212, 191, 0.1);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

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

/* =========================================
   FEATURES (Bento Grid)
   ========================================= */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

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

.glass-panel {
    background: rgba(24, 24, 27, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 4px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-panel:hover::before {
    opacity: 1;
}

.glass-panel.wide {
    grid-column: span 2;
}

.feature-image {
    height: 180px;
    margin: -2rem -2rem 1.5rem -2rem;
    overflow: hidden;
}

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

.glass-panel:hover .feature-image img {
    transform: scale(1.1);
}

/* =========================================
   PLAYGROUND (Terminal Style)
   ========================================= */
.playground-container {
    max-width: 1100px;
}

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

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

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red { background: #EF4444; }
.terminal-dot.yellow { background: #EAB308; }
.terminal-dot.green { background: #22C55E; }

.panel-header h4 {
    margin: 0 0 0 auto;
    font-family: var(--font-code);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-zone, .result-display {
    height: 350px;
    background: #000;
    border: 1px dashed var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--secondary);
    background: rgba(45, 212, 191, 0.05);
}

.upload-placeholder, .result-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
}

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

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

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

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

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

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

.typewriter {
    font-family: var(--font-code);
    color: var(--primary);
}

.hidden { display: none !important; }

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

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

.step-card {
    background: var(--surface);
    padding: 2.5rem 2rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.3s ease;
}

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

.step-icon {
    width: 60px;
    height: 60px;
    background: rgba(45, 212, 191, 0.1);
    color: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

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

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

.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 {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: white;
}

/* =========================================
   WHY USE (Feature Grid 2x2)
   ========================================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.box-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.box-feature:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(244, 114, 182, 0.1);
}

.box-feature h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

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

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

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

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

.testimonial-text {
    font-style: italic;
    color: var(--text-secondary);
}

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

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

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

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

.faq-question::after {
    content: '+';
    font-family: var(--font-code);
    font-size: 1.5rem;
    color: var(--text-muted);
}

.faq-item.active .faq-question::after {
    content: '-';
    color: var(--primary);
}

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

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-bottom: 1.5rem;
}

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

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

.footer-brand p {
    margin-top: 1rem;
    max-width: 300px;
    font-size: 0.9rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

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

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

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

/* =========================================
   MODALS
   ========================================= */
.modal {
    position: fixed;
    inset: 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.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--primary);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

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

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

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

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

.modal-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

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

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .features-grid, .steps-grid, .gallery-grid, .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    html { font-size: 15px; }
    
    .menu-toggle { display: block; }
    
    header nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--background);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }
    
    header nav.active { display: flex; }
    
    .hero {
        padding: 8rem 1rem 4rem;
        min-height: 80vh;
    }
    
    .playground-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid, .steps-grid, .gallery-grid, .testimonials-grid, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .glass-panel.wide {
        grid-column: span 1;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-brand p {
        margin: 1rem auto;
    }
}