@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
    --bg-1: #f4f8f9;
    --bg-2: #dfe9ef;
    --ink: #0f1720;
    --muted: #486072;
    --brand: #0f7b76;
    --brand-strong: #0a5f5b;
    --line: rgba(15, 23, 32, 0.14);
    --card: rgba(255, 255, 255, 0.78);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% -10%, rgba(15, 123, 118, 0.26), transparent 32%),
        linear-gradient(155deg, var(--bg-1), var(--bg-2));
}

main {
    width: min(1050px, 92vw);
    margin: 0 auto;
    padding: 2rem 0 3.5rem;
}

h1,
h2,
p {
    margin: 0;
}

.hero {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 2rem;
    background: var(--card);
    backdrop-filter: blur(8px);
}

.eyebrow {
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--brand-strong);
    font-weight: 700;
}

.hero h1,
.chat-header h1 {
    font-size: clamp(1.45rem, 2.4vw, 2.25rem);
    line-height: 1.15;
}

.lede {
    margin-top: 0.9rem;
    color: var(--muted);
    max-width: 65ch;
}

.lede.small {
    font-size: 0.95rem;
    max-width: 52ch;
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0.62rem 0.95rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.93rem;
    cursor: pointer;
    transition: 140ms ease;
}

.button.primary {
    background: var(--brand);
    color: #fff;
}

.button.primary:hover {
    background: var(--brand-strong);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    border-color: var(--line);
}

.button.secondary:hover {
    background: rgba(255, 255, 255, 1);
}

.button.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

.button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.grid.two {
    margin-top: 1rem;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem;
    background: var(--card);
}

.card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.card p {
    color: var(--muted);
}

.text-link {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--brand-strong);
    text-decoration: none;
    font-weight: 600;
}

.chat-page {
    display: grid;
    gap: 1rem;
}

.chat-header {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.2rem;
    background: var(--card);
}

.chat-card {
    padding: 0.85rem;
}

.chat-thread {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    height: min(58vh, 580px);
    overflow-y: auto;
    padding: 0.8rem;
    display: grid;
    gap: 0.55rem;
}

.msg {
    border-radius: 10px;
    padding: 0.7rem;
    max-width: 85%;
    border: 1px solid var(--line);
}

.msg.user {
    margin-left: auto;
    background: rgba(15, 123, 118, 0.13);
}

.msg.assistant {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.95);
}

.msg .meta {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.msg .body {
    margin-top: 0.32rem;
    white-space: pre-wrap;
}

.chat-form {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.55rem;
}

textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 0.7rem 0.8rem;
    font: inherit;
    resize: vertical;
    min-height: 76px;
}

textarea:focus {
    outline: 2px solid rgba(15, 123, 118, 0.28);
    outline-offset: 1px;
}

.chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hint {
    font-size: 0.8rem;
    color: var(--muted);
}

.error {
    color: #9a1d29;
    font-size: 0.86rem;
}

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

@media (max-width: 760px) {
    main {
        width: min(1050px, 94vw);
        padding-top: 1.3rem;
    }

    .hero,
    .chat-header,
    .card {
        padding: 1rem;
    }

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

    .msg {
        max-width: 95%;
    }

    .chat-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
