/* ===== CSS Variables ===== */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #ffffff;
    --bg-light: #f7fafc;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header & Navigation ===== */
.header {
    background: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.2rem;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

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

.nav-menu a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    background: var(--bg-gradient);
    color: white;
    padding: 8rem 0;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.9rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

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

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

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

/* ===== Sections ===== */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* ===== Features Section ===== */
.features {
    background: var(--bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Demo Section ===== */
.demo {
    background: linear-gradient(180deg, #f9faff 0%, #ffffff 100%);
}

.demo-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    align-items: stretch;
}

.demo-panel {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.demo-panel h3 {
    margin: 0;
    color: var(--text-color);
    text-align: left;
}

.demo-panel.demo-output {
    background: white;
    justify-content: space-between;
    gap: 2rem;
}

.demo-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.mode-switch {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    padding: 0.4rem;
    background: rgba(102, 126, 234, 0.08);
    border-radius: var(--border-radius);
}

.mode-btn {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.05);
}

.mode-btn.active {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

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

.prompt-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prompt-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

#promptInput {
    width: 100%;
    border-radius: var(--border-radius);
    border: 1px solid rgba(113, 128, 150, 0.3);
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 140px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
}

#promptInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-error {
    border-color: #f56565 !important;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.15) !important;
}

.prompt-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.demo-btn {
    flex: 1 1 160px;
    text-align: center;
}

.sample-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    border: 1px solid rgba(102, 126, 234, 0.2);
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: transparent;
}

.response-content {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    border: 1px dashed rgba(102, 126, 234, 0.2);
}

.response-placeholder {
    color: var(--text-light);
    font-style: italic;
}

.response-block h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.response-block ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-light);
}

.response-highlight {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--text-color);
}

.response-detail {
    color: var(--text-light);
    font-size: 0.95rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(118, 75, 162, 0.12);
    color: var(--secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.4rem;
}

.badge.positive {
    background: rgba(72, 187, 120, 0.15);
    color: #2f855a;
}

.kb-citations {
    margin-top: 0.5rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: auto;
}

.metric-card {
    background: rgba(102, 126, 234, 0.08);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: none;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.vision-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: center;
}

.vision-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.35));
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.vision-preview::after {
    content: '';
    position: absolute;
    inset: 18%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
}

pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

code {
    font-family: 'Fira Code', 'Source Code Pro', monospace;
    font-size: 0.85rem;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-light);
}

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

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-color);
}

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

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-link {
    padding: 1rem 2rem;
    background: var(--bg-light);
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.contact-link:hover {
    background: var(--bg-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== Footer ===== */
.footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
}

.footer-note {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

    .demo-container {
        grid-template-columns: 1fr;
    }

    .mode-switch {
        grid-template-columns: repeat(2, 1fr);
    }

    .prompt-actions {
        flex-direction: column;
    }

    .demo-btn {
        width: 100%;
    }

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

    .hero {
        padding: 5rem 0;
    }

    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card,
.demo-panel {
    animation: fadeIn 0.6s ease-out;
}
