:root {
    --bg: #0a0d12;
    --panel: #11151d;
    --panel-border: #1f2530;
    --text: #e8ecf1;
    --muted: #8b95a5;
    --accent-hot: #ff5a2e;
    --accent-cold: #2fb2ff;
    --gradient: linear-gradient(90deg, var(--accent-hot), var(--accent-cold));
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}

.page {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: clamp(6px, 1.4vh, 18px);
    padding: clamp(10px, 2vh, 22px) clamp(14px, 3vw, 40px);
}

/* ---- header ---- */
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-logo {
    width: clamp(28px, 4vh, 40px);
    height: clamp(28px, 4vh, 40px);
    border-radius: 8px;
}

.brand-name {
    font-weight: 700;
    font-size: clamp(1.05rem, 2vh, 1.4rem);
    letter-spacing: 0.02em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lang-toggle {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    letter-spacing: 0.04em;
}

.lang-toggle .lang-opt.active {
    color: var(--text);
}

.lang-toggle .lang-sep {
    opacity: 0.4;
    margin: 0 3px;
}

/* ---- main content ---- */
.content {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(12px, 2.4vw, 32px);
    min-height: 0;
}

.pitch {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(10px, 1.8vh, 20px);
    min-height: 0;
}

.tagline {
    margin: 0;
    font-size: clamp(1.4rem, 3.2vh, 2.4rem);
    line-height: 1.15;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.85rem, 1.7vh, 1.05rem);
    line-height: 1.45;
    max-width: 46ch;
}

.features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 12px);
}

.features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.82rem, 1.6vh, 0.98rem);
}

.feature-icon {
    flex: none;
    width: clamp(22px, 3vh, 28px);
    height: clamp(22px, 3vh, 28px);
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 90, 46, 0.12);
    color: var(--accent-hot);
}

.features li:nth-child(2) .feature-icon {
    background: rgba(47, 178, 255, 0.12);
    color: var(--accent-cold);
}

.features li:nth-child(3) .feature-icon {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.feature-icon svg {
    width: 60%;
    height: 60%;
}

.footnote {
    margin: clamp(4px, 1vh, 10px) 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.footnote a {
    color: var(--accent-cold);
    text-decoration: none;
}

.footnote a:hover {
    text-decoration: underline;
}

/* ---- chat ---- */
.chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: clamp(10px, 1.6vh, 14px) clamp(12px, 2vw, 18px);
    border-bottom: 1px solid var(--panel-border);
    font-weight: 600;
    font-size: clamp(0.82rem, 1.6vh, 0.95rem);
    flex: none;
}

.chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-cold);
    box-shadow: 0 0 0 3px rgba(47, 178, 255, 0.18);
}

.chat-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(10px, 1.6vh, 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.msg {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: clamp(0.8rem, 1.5vh, 0.92rem);
    line-height: 1.4;
    white-space: pre-wrap;
}

.msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 4px;
}

.msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(255, 90, 46, 0.22), rgba(47, 178, 255, 0.22));
    border-bottom-right-radius: 4px;
}

.msg.pending {
    opacity: 0.6;
}

.chat-form {
    flex: none;
    display: flex;
    gap: 8px;
    padding: clamp(8px, 1.4vh, 12px);
    border-top: 1px solid var(--panel-border);
}

.chat-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 0.9rem;
    min-width: 0;
}

.chat-form input:focus {
    outline: none;
    border-color: var(--accent-cold);
}

.chat-form button {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--gradient);
    color: #0a0d12;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.chat-form button svg {
    width: 18px;
    height: 18px;
}

/* ---- footer ---- */
.bottom {
    text-align: center;
    color: var(--muted);
    font-size: 0.72rem;
    opacity: 0.7;
}

/* ---- responsive ---- */
@media (max-width: 860px) {
    .content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .pitch {
        justify-content: flex-start;
        gap: 8px;
    }

    .subtitle {
        max-width: none;
    }

    .features {
        display: none;
    }

    .footnote {
        margin-top: 2px;
    }
}

@media (max-width: 860px) and (min-height: 700px) {
    .features {
        display: flex;
    }
}
