/* ==========================================================================
   MOONSHOT AI - Core Design System & Global Stylesheet
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
    /* Color Palette */
    --bg-dark: #030712;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.4);

    --primary-cyan: #06b6d4;
    --primary-indigo: #6366f1;
    --primary-violet: #8b5cf6;
    --primary-pink: #ec4899;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Typography */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /* Layout & Utilities */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-glow-cyan: 0 0 35px rgba(6, 182, 212, 0.35);
    --shadow-glow-violet: 0 0 35px rgba(139, 92, 246, 0.35);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

a {
    color: inherit;
    text-decoration: none;
}

button, select, textarea {
    font-family: inherit;
}

.sr-only-hero-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Canvas & Animated Background Container --- */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-scene-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.scene-frame {
    width: 100%;
    height: 100%;
}

#hero-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.12) 0%, rgba(3, 7, 18, 0.85) 75%);
    pointer-events: none;
}

.grid-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

/* --- Layout Container --- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header / Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 18px 0;
    transition: var(--transition-smooth);
}

.header.scrolled {
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 0;
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.logo-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
    transition: var(--transition-fast);
}

.logo:hover .logo-icon-wrapper {
    transform: rotate(10deg) scale(1.05);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.7);
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 2px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-violet));
    transition: var(--transition-fast);
    border-radius: 2px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    outline: none;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-indigo));
    color: #ffffff;
    box-shadow: var(--shadow-glow-cyan);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 45px rgba(99, 102, 241, 0.6);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-glass {
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary-violet);
    transform: translateY(-2px);
}

.glowing-btn {
    position: relative;
    overflow: hidden;
}

.glowing-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.8s ease;
}

.glowing-btn:hover::before {
    transform: rotate(45deg) translateY(100%);
}

/* --- Hero Section --- */
.hero-section {
    padding-top: 180px;
    padding-bottom: 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: #d8b4fe;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
    cursor: pointer;
}

.hero-badge:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.02);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-cyan);
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-family: var(--font-heading);
    font-size: 4.2rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    max-width: 960px;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 10%, var(--primary-cyan) 50%, var(--primary-violet) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow-effect {
    filter: drop-shadow(0 0 35px rgba(6, 182, 212, 0.4));
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 760px;
    margin-bottom: 40px;
    font-weight: 400;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 70px;
}

/* --- Hero Stats --- */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 960px;
    padding: 30px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.stat-card {
    text-align: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main), var(--primary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-value span {
    font-size: 1.5rem;
}

.stat-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card-divider {
    width: 1px;
    height: 45px;
    background: var(--border-glass);
}

/* --- Section Global Layout --- */
.section {
    padding: 120px 0;
    position: relative;
}

.section-header {
    margin-bottom: 60px;
}

.section-header.center {
    text-align: center;
}

.section-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--primary-cyan);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow-violet);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-cyan);
    font-size: 1.6rem;
    margin-bottom: 24px;
    transition: var(--transition-fast);
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-violet));
    color: #ffffff;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
}

.feature-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.feature-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-list li {
    font-size: 0.88rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-list li i {
    color: var(--primary-cyan);
    font-size: 1rem;
}

/* --- Playground Section --- */
.playground-window {
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(24px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.window-header {
    background: rgba(15, 23, 42, 0.9);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red { background: #ff5f56; }
.control.yellow { background: #ffbd2e; }
.control.green { background: #27c93f; }

.model-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selector-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.model-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.status-dot.pulsing {
    box-shadow: 0 0 10px #10b981;
    animation: pulse 1.8s infinite;
}

.playground-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 480px;
}

.presets-sidebar {
    background: rgba(15, 23, 42, 0.5);
    border-right: 1px solid var(--border-glass);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.presets-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.preset-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary-cyan);
    font-weight: 600;
}

.terminal-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.terminal-output {
    padding: 24px;
    font-family: var(--font-code);
    font-size: 0.92rem;
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

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

.message.user-msg {
    color: var(--primary-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-cyan);
}

.message.ai-msg {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-violet);
    white-space: pre-wrap;
}

.terminal-input-bar {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.terminal-input-bar textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-main);
    padding: 12px 16px;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: var(--transition-fast);
}

.terminal-input-bar textarea:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.send-btn {
    border-radius: var(--radius-md);
    height: 48px;
}

/* --- Benchmarks Section --- */
.benchmarks-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 40px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
}

.benchmark-bar-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
}

.bar-score {
    color: var(--primary-cyan);
    font-family: var(--font-code);
}

.progress-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-violet));
    transition: width 1.5s ease-out;
}

.fill-glow {
    box-shadow: 0 0 15px var(--primary-cyan);
}

/* --- Enterprise & CTA --- */
.cta-banner {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: var(--radius-lg);
    padding: 70px 50px;
    position: relative;
    overflow: hidden;
    text-align: center;
    backdrop-filter: blur(20px);
}

.cta-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 18px;
}

.cta-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 36px auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border-glass);
    padding: 80px 0 40px 0;
    background: rgba(3, 7, 18, 0.95);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    max-width: 320px;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.social-link:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    transform: translateY(-3px);
}

.footer-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.footer-links-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.85rem;
    color: var(--text-dim);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3.2rem;
    }
    
    .playground-body {
        grid-template-columns: 1fr;
    }

    .presets-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        flex-direction: row;
        overflow-x: auto;
    }

    .preset-btn {
        white-space: nowrap;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .stat-card-divider {
        width: 100%;
        height: 1px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
