/* ============================================
   Helix Image Studio — Design System
   Acid Neon Palette with Brutalist Elements
   ============================================ */

:root {
    /* Acid Neon Palette */
    --color-primary: #CCFF00;
    --color-secondary: #FF3CAC;
    --color-bg: #0D0D0D;
    --color-surface: #1A1A2E;
    --color-surface-light: #252542;
    --color-text: #FFFFFF;
    --color-text-muted: #A0A0B0;
    --color-border: #333355;
    
    /* Typography */
    --font-display: 'Clash Display', sans-serif;
    --font-body: 'Chillax', sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Shadows */
    --shadow-glow: 0 0 40px rgba(204, 255, 0, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Base & Reset
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-logo {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.nav-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: calc(var(--space-2xl) + 60px) var(--space-xl) var(--space-2xl);
    gap: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
}

.title-line {
    display: block;
}

.title-line.accent {
    color: var(--color-primary);
    text-shadow: 0 0 40px rgba(204, 255, 0, 0.4);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    max-width: 480px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

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

.btn-arrow {
    transition: transform var(--transition-base);
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 100%;
    min-height: 500px;
}

.floating-card {
    position: absolute;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: float 6s ease-in-out infinite;
}

.floating-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-1 {
    width: 280px;
    height: 280px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    z-index: 3;
}

.card-2 {
    width: 220px;
    height: 220px;
    top: 40%;
    right: 5%;
    animation-delay: -2s;
    z-index: 2;
}

.card-3 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    left: 25%;
    animation-delay: -4s;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.gradient-orb {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(204, 255, 0, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    z-index: 0;
}

/* ============================================
   Generator Section
   ============================================ */

.generator {
    padding: var(--space-2xl) var(--space-xl);
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.generator-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
}

/* Input Panel */
.input-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: var(--space-xl);
}

.input-group {
    margin-bottom: var(--space-lg);
}

.input-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group textarea {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.input-group textarea::placeholder {
    color: var(--color-text-muted);
}

.input-hint {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--color-text-muted);
}

/* Ratio Buttons */
.ratio-buttons {
    display: flex;
    gap: var(--space-xs);
}

.ratio-btn {
    flex: 1;
    padding: var(--space-sm);
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.ratio-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
}

/* Select */
.option-group select {
    width: 100%;
    padding: var(--space-sm);
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}

.option-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: var(--space-xs);
}

.toggle-btn {
    flex: 1;
    padding: var(--space-sm);
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-btn.active {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: var(--color-text);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, #B8E600 100%);
    border: none;
    border-radius: 12px;
    color: var(--color-bg);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(204, 255, 0, 0.3);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-bg);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.generate-btn.loading .btn-text,
.generate-btn.loading .btn-icon {
    opacity: 0;
}

.generate-btn.loading .btn-loader {
    display: block;
    position: absolute;
}

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

/* Output Panel */
.output-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.output-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-muted);
}

.placeholder-icon {
    font-size: 4rem;
    color: var(--color-border);
    margin-bottom: var(--space-md);
}

.placeholder-hint {
    font-size: 0.9rem;
    margin-top: var(--space-sm);
}

.output-image {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.output-image img {
    width: 100%;
    flex: 1;
    object-fit: contain;
    border-radius: 12px;
    background: var(--color-surface-light);
}

.image-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.action-btn {
    width: 48px;
    height: 48px;
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ============================================
   Features Section
   ============================================ */

.features {
    padding: var(--space-2xl) var(--space-xl);
}

.features-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-surface-light) 0%, var(--color-surface) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   Gallery Section
   ============================================ */

.gallery {
    padding: var(--space-2xl) var(--space-xl);
    background: var(--color-surface);
}

.gallery-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: var(--space-md);
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.gallery-tag {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary);
    color: var(--color-bg);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
}

/* ============================================
   CTA Section
   ============================================ */

.cta-section {
    padding: var(--space-2xl) var(--space-xl);
    position: relative;
    overflow: hidden;
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.cta-content h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.cta-content p {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: var(--space-xl);
}

.cta-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.cta-orb {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 60, 172, 0.1) 0%, transparent 70%);
    filter: blur(80px);
}

/* ============================================
   Footer
   ============================================ */

.footer {
    padding: var(--space-2xl) var(--space-xl) var(--space-xl);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.footer-logo {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.footer-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
}

.footer-tagline {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

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

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

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .generator-container {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item.wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: var(--space-md);
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        padding: calc(var(--space-2xl) + 60px) var(--space-md) var(--space-xl);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
    
    .gallery-item.tall,
    .gallery-item.wide {
        grid-row: span 1;
        grid-column: span 1;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .input-panel,
    .output-panel {
        padding: var(--space-md);
    }
}

/* ============================================
   Scroll Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}