:root {
    color-scheme: dark;
    --bg: #0a0c10;
    --bg-elev: #0f141b;
    --text: #e6f0ff;
    --muted: #a6b3c4;
    --neon-cyan: #4dfcff;
    --neon-lime: #b8ff4d;
    --neon-orange: #ff9f4d;
    --accent: #4dfcff;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Space Grotesk", system-ui, sans-serif;
    background: radial-gradient(1200px 800px at 10% -10%, rgba(77, 252, 255, 0.18), transparent),
                radial-gradient(900px 700px at 90% -20%, rgba(184, 255, 77, 0.12), transparent),
                var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(10, 12, 16, 0.8);
    border-bottom: 1px solid var(--line);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 0;
    gap: 16px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}
.logo span { color: var(--neon-cyan); }
.nav-links {
    display: flex;
    gap: 22px;
    font-size: 14px;
    color: var(--muted);
    flex-wrap: wrap;
}
.nav-cta-group {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}
.nav-cta {
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(77, 252, 255, 0.2), rgba(184, 255, 77, 0.2));
    border: 1px solid rgba(77, 252, 255, 0.5);
    font-weight: 600;
    font-size: 13px;
}
.nav-cta.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--muted);
}

.hero {
    padding: 80px 0 40px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
}
.eyebrow {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--neon-lime);
    margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(36px, 5vw, 60px);
    line-height: 1.05;
    margin-bottom: 18px;
}
.hero p {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 28px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-primary {
    background: linear-gradient(120deg, var(--neon-cyan), var(--neon-lime));
    color: #0a0c10;
    box-shadow: 0 12px 30px rgba(77, 252, 255, 0.25);
}
.btn-secondary {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
}
.card h4 {
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--neon-cyan);
}
.card ul {
    list-style: none;
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

section {
    padding: 70px 0;
    border-top: 1px solid var(--line);
}
.section-title {
    font-size: 28px;
    margin-bottom: 14px;
}
.section-subtitle {
    color: var(--muted);
    margin-bottom: 32px;
    max-width: 650px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.tagline {
    margin-top: 24px;
    font-family: "IBM Plex Mono", monospace;
    color: var(--neon-lime);
}

.cta {
    text-align: center;
    background: linear-gradient(140deg, rgba(77, 252, 255, 0.12), rgba(255, 159, 77, 0.12));
    border-radius: 20px;
    border: 1px solid rgba(77, 252, 255, 0.2);
    padding: 50px 30px;
}
.cta h2 {
    font-size: clamp(28px, 4vw, 44px);
    margin-bottom: 12px;
}
.cta p {
    color: var(--muted);
    margin-bottom: 20px;
}

footer {
    padding: 40px 0 60px;
    color: var(--muted);
    font-size: 14px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.footer-grid h5 {
    color: var(--text);
    margin-bottom: 8px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.form-grid input,
.form-grid select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #0b0f16;
    color: var(--text);
}

.chat {
    margin-top: 24px;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(10, 12, 16, 0.6);
}

.chat-message {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.assistant {
    background: rgba(77, 252, 255, 0.08);
    border: 1px solid rgba(77, 252, 255, 0.2);
    align-self: flex-start;
    max-width: 90%;
}

.chat-message.user {
    background: rgba(184, 255, 77, 0.08);
    border: 1px solid rgba(184, 255, 77, 0.2);
    align-self: flex-end;
    max-width: 85%;
}

.chat-input {
    display: flex;
    gap: 12px;
    padding: 16px 0 0;
}

.chat-input input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #0b0f16;
    color: var(--text);
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(77, 252, 255, 0.2);
}

.chat-input .btn {
    padding: 14px 24px;
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--neon-cyan);
}

.social-link img {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}

.social-link svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .nav { flex-wrap: wrap; }
}

.chat-primary {
    background: var(--bg-elev);
    border: 2px solid var(--neon-cyan);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 0 40px rgba(77, 252, 255, 0.15);
    margin-bottom: 40px;
}

.chat-header {
    margin-bottom: 24px;
}

.chat-header h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.chat-header p {
    color: var(--muted);
    font-size: 16px;
    margin: 0;
}

.or-divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line);
}

.or-divider span {
    padding: 0 24px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.form-secondary {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
}

.form-header h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.form-header p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    min-height: 500px;
}

.chat-sidebar {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
}

.chat-sidebar h3 {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#collected-fields {
    display: grid;
    gap: 12px;
}

.field-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(10, 12, 16, 0.5);
    transition: all 0.2s ease;
}

.field-item label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.field-item .value {
    display: block;
    font-size: 14px;
    color: var(--text);
    min-height: 20px;
}

.field-item .status {
    display: block;
    font-size: 10px;
    margin-top: 4px;
}

.field-item.completed {
    border-color: rgba(77, 252, 255, 0.3);
    background: rgba(77, 252, 255, 0.05);
}

.field-item.completed .status::before {
    content: "✓";
    color: var(--neon-cyan);
}

.field-item.pending {
    border-color: rgba(255, 255, 255, 0.1);
}

.field-item.pending .status {
    color: var(--muted);
}

.progress-indicator {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-lime));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-text {
    font-size: 11px;
    color: var(--muted);
}

.missing-fields {
    font-size: 10px;
    color: rgba(77, 252, 255, 0.7);
    line-height: 1.3;
}

.missing-fields::before {
    content: "Still needed: ";
    font-weight: 600;
}

.chat-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-content {
    display: flex;
    flex-direction: column;
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.assistant {
    background: rgba(77, 252, 255, 0.08);
    border: 1px solid rgba(77, 252, 255, 0.2);
    align-self: flex-start;
    max-width: 90%;
}

.chat-message.user {
    background: rgba(184, 255, 77, 0.08);
    border: 1px solid rgba(184, 255, 77, 0.2);
    align-self: flex-end;
    max-width: 85%;
}

.chat-input {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid rgba(77, 252, 255, 0.1);
    background: rgba(10, 12, 16, 0.8);
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(77, 252, 255, 0.2);
    background: rgba(10, 12, 16, 0.9);
    color: var(--text);
    font-size: 14px;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(77, 252, 255, 0.2);
}

.chat-input .btn {
    padding: 14px 24px;
}

.chat-thread {
    flex: 1;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

@media (min-width: 769px) {
    .chat-thread {
        max-height: 400px;
    }

    .chat-content {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .chat-thread {
        max-height: 300px;
    }

    .chat-content {
        border-radius: 12px;
    }
}

.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

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

.hidden {
    display: none !important;
}

@media (min-width: 769px) {
    .chat-layout {
        grid-template-columns: 280px 1fr;
        grid-template-rows: 1fr;
        min-height: 500px;
    }

    .chat-sidebar {
        grid-row: 1 / -1;
        display: flex;
        flex-direction: column;
    }

    .chat-main {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .chat-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .chat-thread {
        flex: 1;
        overflow-y: auto;
        max-height: none;
    }

    .chat-input {
        flex-shrink: 0;
    }

    #collected-fields {
        flex: 1;
    }

    .progress-indicator {
        margin-top: auto;
    }
}

@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        order: 2;
    }

    .chat-main {
        order: 1;
    }

    .ux-mode-toggle {
        flex-direction: column;
    }

    .mode-btn.recommended {
        flex: 1;
    }
}

.streaming-message {
    min-height: 1.5em;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text);
    letter-spacing: normal;
    white-space: normal;
}

.streaming-message p {
    margin-bottom: 12px;
}

.streaming-message p:last-child {
    margin-bottom: 0;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--neon-lime);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 1px;
}

.typing-cursor.final {
    animation: blink 1.2s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.streaming-loading {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-lime);
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.streaming-message.fallback {
    padding: 16px;
    background: rgba(77, 252, 255, 0.05);
    border: 1px solid rgba(77, 252, 255, 0.1);
    border-radius: 12px;
}

.streaming-message.fallback p {
    margin-bottom: 12px;
}

.streaming-message.fallback a {
    color: var(--neon-cyan);
    text-decoration: underline;
}

.streaming-message.fallback a:hover {
    color: var(--neon-lime);
}
