:root {
    --bg: #070914;
    --panel: rgba(12, 16, 31, 0.82);
    --panel-2: rgba(17, 22, 42, 0.88);
    --line: rgba(255, 255, 255, 0.09);
    --text: #f6f7fb;
    --muted: #9299b1;
    --purple: #8b5cf6;
    --cyan: #22d3ee;
    --green: #34d399;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(124, 58, 237, 0.15), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(34, 211, 238, 0.10), transparent 25%),
        var(--bg);
    font-family: "Inter", system-ui, sans-serif;
    overflow-x: hidden;
}

button,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.23;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.orb {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.12;
    pointer-events: none;
}

.orb-a {
    background: #7c3aed;
    top: 22%;
    left: -160px;
}

.orb-b {
    background: #06b6d4;
    right: -180px;
    bottom: 10%;
}

.app-shell {
    width: min(1420px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 26px;
}

.topbar,
.hero,
.chat-card {
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.24), rgba(34, 211, 238, 0.08));
    color: #c4b5fd;
    font-weight: 800;
    box-shadow: inset 0 0 24px rgba(139, 92, 246, 0.12);
}

.brand-name {
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.brand-name span {
    color: #a78bfa;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-pill {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.035);
    padding: 8px 12px;
    border-radius: 999px;
    color: #c8cce0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px var(--green);
}

.icon-button {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.035);
    cursor: pointer;
    color: #cbd0e1;
    transition: 0.2s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.12);
}

.hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 50px;
    align-items: center;
    padding: 56px 8px 40px;
}

.eyebrow {
    color: #9f8df8;
    font-size: 10px;
    letter-spacing: 2.2px;
    font-weight: 800;
    margin-bottom: 13px;
}

.hero h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -3.5px;
}

.hero h1 span {
    background: linear-gradient(90deg, #a78bfa, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-copy p {
    max-width: 650px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 14px;
    margin: 20px 0 0;
}

.hero-terminal {
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 20px;
    background: rgba(9, 12, 24, 0.88);
    box-shadow: var(--shadow);
    overflow: hidden;
    transform: rotate(1deg);
}

.terminal-head {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    border-bottom: 1px solid var(--line);
    color: #777f98;
    font: 11px "Space Grotesk", sans-serif;
}

.traffic-lights {
    display: flex;
    gap: 5px;
    margin-right: 4px;
}

.traffic-lights i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #454b60;
}

.terminal-live {
    margin-left: auto;
    color: #52d6a1;
    font-size: 9px;
}

.terminal-code {
    padding: 25px 18px 30px;
    color: #bfc6dc;
    font: 13px/2.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.line-no {
    display: inline-block;
    width: 30px;
    color: #454c64;
    user-select: none;
}

.kw { color: #c084fc; }
.fn { color: #67e8f9; }
.bool { color: #fbbf24; }
.str { color: #86efac; }

.chat-card {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 650px;
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    background: var(--panel);
    backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.side-panel {
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,0.018);
    padding: 22px;
}

.side-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.mini-logo {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(139,92,246,0.28), rgba(34,211,238,0.12));
    color: #c4b5fd;
}

.side-title strong {
    display: block;
    font-size: 12px;
}

.side-title small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    font-size: 10px;
}

.scope-box {
    display: flex;
    gap: 10px;
    margin: 18px 0 22px;
    padding: 13px;
    border: 1px solid rgba(52, 211, 153, 0.16);
    background: rgba(52, 211, 153, 0.045);
    border-radius: 13px;
}

.scope-icon {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.1);
}

.scope-box strong {
    font-size: 11px;
}

.scope-box p {
    color: #7f8a9f;
    font-size: 10px;
    line-height: 1.5;
    margin: 4px 0 0;
}

.suggestions > span {
    display: block;
    color: #626b82;
    font-size: 9px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 9px;
    font-weight: 800;
}

.suggestion {
    width: 100%;
    text-align: left;
    padding: 11px 12px;
    margin: 4px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #aeb5c8;
    font-size: 10px;
    line-height: 1.45;
    cursor: pointer;
    transition: 0.18s ease;
}

.suggestion:hover {
    color: #e8eaf2;
    border-color: rgba(139,92,246,0.18);
    background: rgba(139,92,246,0.07);
}

.chat-area {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 80% 20%, rgba(139,92,246,0.045), transparent 35%),
        rgba(5, 8, 18, 0.3);
}

.messages {
    flex: 1;
    min-height: 0;
    padding: 25px;
    overflow-y: auto;
    max-height: 530px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.35) transparent;
}

.message-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    animation: rise 0.25s ease both;
}

.message-row.user {
    justify-content: flex-end;
}

.avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.bot-avatar {
    background: linear-gradient(135deg, #7c3aed, #0891b2);
    box-shadow: 0 8px 25px rgba(124,58,237,0.22);
}

.user-avatar {
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
}

.bubble {
    max-width: min(780px, 80%);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 15px;
    font-size: 13px;
    line-height: 1.65;
    color: #dfe3ee;
}

.bot-bubble {
    background: rgba(255,255,255,0.035);
    border-top-left-radius: 5px;
}

.user-bubble {
    background: linear-gradient(135deg, rgba(124,58,237,0.8), rgba(79,70,229,0.72));
    border-color: rgba(167,139,250,0.24);
    border-top-right-radius: 5px;
    color: white;
}

.bubble p {
    margin: 0 0 9px;
}

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

.bubble ul,
.bubble ol {
    padding-left: 20px;
}

.bubble pre {
    margin: 12px 0 3px;
    padding: 13px;
    border-radius: 10px;
    overflow-x: auto;
    background: #050711;
    border: 1px solid rgba(255,255,255,0.07);
}

.bubble code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.bubble :not(pre) > code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(255,255,255,0.08);
}

.typing {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 25px 15px;
    color: #697289;
    font-size: 10px;
}

.typing-bubble {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,0.035);
}

.typing-bubble span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9b8af6;
    animation: blink 1s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

.hidden {
    display: none !important;
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 20px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    background: rgba(255,255,255,0.045);
}

.composer textarea {
    flex: 1;
    resize: none;
    max-height: 140px;
    min-height: 42px;
    padding: 11px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #f3f4f8;
    font-size: 13px;
    line-height: 1.5;
}

.composer textarea::placeholder {
    color: #646d83;
}

#sendButton {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #4f46e5);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.25);
    transition: 0.18s ease;
}

#sendButton:hover {
    transform: translateY(-1px) scale(1.02);
}

#sendButton:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    padding: 7px 25px 15px;
    color: #535c73;
    font-size: 9px;
}

footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    color: #4f586d;
    font-size: 9px;
    padding: 17px 0 0;
}

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

@keyframes blink {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 950px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 42px;
    }

    .hero-terminal {
        max-width: 720px;
        width: 100%;
        justify-self: center;
    }

    .chat-card {
        grid-template-columns: 1fr;
    }

    .side-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .suggestions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .suggestions > span {
        grid-column: 1 / -1;
    }

    .suggestion {
        margin: 0;
    }
}

@media (max-width: 650px) {
    .app-shell {
        width: min(100% - 20px, 1420px);
        padding-top: 12px;
    }

    .brand-subtitle {
        display: none;
    }

    .status-pill {
        font-size: 9px;
        padding: 7px 9px;
    }

    .hero {
        padding: 38px 3px 28px;
        gap: 20px;
    }

    .hero h1 {
        font-size: clamp(39px, 13vw, 58px);
        letter-spacing: -2.5px;
    }

    .hero-copy p {
        font-size: 12px;
    }

    .terminal-code {
        font-size: 10px;
        padding: 19px 10px 22px;
    }

    .chat-card {
        border-radius: 18px;
        min-height: 600px;
    }

    .side-panel {
        padding: 16px;
    }

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

    .messages {
        padding: 17px 13px;
        max-height: 520px;
    }

    .bubble {
        max-width: 88%;
        font-size: 12px;
    }

    .composer {
        margin: 0 11px;
    }

    .composer-footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    footer {
        flex-wrap: wrap;
        text-align: center;
        line-height: 1.6;
    }
}
