/* SkyRock Mentor. Palette and type follow skyrock.agency. */

:root {
    --navy: #103576;
    --navy-deep: #0b2657;
    --navy-night: #07193b;
    --gold: #f2d79f;
    --gold-deep: #cfae70;
    --gold-text: #8a6d2b;
    --cream: #f7f3e8;
    --ink: #1f2a3a;
    --muted: #5b6474;
    --line: #e6e0d0;
    --white: #ffffff;
    --danger: #a12a2a;
    --radius: 14px;
    --shadow-sm: 0 6px 20px rgba(31, 42, 58, 0.07);
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-heading: 'Exo 2', 'Segoe UI', Arial, sans-serif;
    --column: 780px;
}

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: var(--navy);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Header */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--navy-night);
    color: var(--white);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand-name {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.2;
    color: var(--gold);
}

.brand-tagline {
    display: block;
    font-size: 0.78rem;
    color: #c9d4ea;
    line-height: 1.3;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Buttons */

.button {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 18px;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.button:focus-visible,
.chip:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gold-deep);
    outline-offset: 2px;
}

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

.button-primary:hover {
    background: var(--navy-deep);
}

.button-primary:disabled {
    background: #8d99b3;
    cursor: not-allowed;
}

.button-quiet {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--white);
}

.button-quiet:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.button-quiet[aria-pressed='true'] {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-night);
}

.dialog .button-quiet {
    border-color: var(--line);
    color: var(--ink);
}

.dialog .button-quiet:hover {
    border-color: var(--navy);
    color: var(--navy);
}

/* Conversation */

.chat {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.welcome,
.messages {
    max-width: var(--column);
    margin: 0 auto;
}

.welcome {
    text-align: center;
    padding: 4vh 0 16px;
}

.welcome h1 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--navy-deep);
}

.welcome p {
    margin: 0 auto 20px;
    max-width: 560px;
    color: var(--muted);
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.chip:hover {
    border-color: var(--gold-deep);
    color: var(--navy);
}

.back-link {
    margin-top: 22px;
    border: none;
    background: none;
    color: var(--navy);
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: underline;
    cursor: pointer;
}

.back-link:hover {
    color: var(--gold-text);
}

.back-link:focus-visible {
    outline: 3px solid var(--gold-deep);
    outline-offset: 2px;
}

.back-link[hidden] {
    display: none;
}

.message {
    display: flex;
    margin: 0 0 18px;
}

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

.bubble {
    max-width: 100%;
    border-radius: var(--radius);
    padding: 14px 18px;
    overflow-wrap: anywhere;
}

.message-user .bubble {
    max-width: 85%;
    background: var(--navy);
    color: var(--white);
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}

.message-mentor .bubble {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold-deep);
    box-shadow: var(--shadow-sm);
}

.message-error .bubble {
    border-left-color: var(--danger);
    color: var(--danger);
}

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

.bubble ul {
    margin: 0 0 12px;
    padding-left: 22px;
}

.bubble li {
    margin-bottom: 4px;
}

.bubble blockquote {
    margin: 0 0 12px;
    padding: 10px 16px;
    border-left: 3px solid var(--gold-deep);
    background: var(--cream);
    border-radius: 0 10px 10px 0;
    font-family: Georgia, 'Times New Roman', serif;
}

.bubble blockquote p {
    margin: 0;
}

.bubble blockquote p + p {
    margin-top: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--muted);
}

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

.sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--muted);
}

.sources summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--gold-text);
}

.sources ul {
    margin: 8px 0 0;
}

.mode-note {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--muted);
}

.thinking {
    display: inline-flex;
    gap: 5px;
    padding: 4px 0;
}

.thinking span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-deep);
    animation: pulse 1.2s infinite ease-in-out;
}

.thinking span:nth-child(2) {
    animation-delay: 0.15s;
}

.thinking span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .thinking span {
        animation: none;
        opacity: 0.6;
    }
}

/* Model download status */

.model-status {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--column);
    width: 100%;
    margin: 0 auto;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--muted);
}

.model-status[hidden] {
    display: none;
}

.model-status progress {
    flex: 1;
    height: 8px;
    accent-color: var(--navy);
}

/* Composer */

.composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: var(--column);
    width: 100%;
    margin: 0 auto;
    padding: 10px 16px;
}

.composer textarea {
    flex: 1;
    min-height: 48px;
    max-height: 180px;
    resize: none;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
    box-shadow: var(--shadow-sm);
}

.composer .button {
    height: 48px;
    padding: 0 24px;
}

/* Footer */

.site-footer {
    max-width: var(--column);
    width: 100%;
    margin: 0 auto;
    padding: 0 16px 12px;
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--muted);
    text-align: center;
}

.site-footer p {
    margin: 0 0 4px;
}

/* Dialog */

.dialog {
    max-width: 480px;
    width: calc(100% - 32px);
    border: none;
    border-radius: var(--radius);
    padding: 24px;
    color: var(--ink);
    box-shadow: 0 16px 36px rgba(31, 42, 58, 0.3);
}

.dialog::backdrop {
    background: rgba(7, 25, 59, 0.6);
}

.dialog h2 {
    margin: 0 0 8px;
    font-family: var(--font-heading);
    color: var(--navy-deep);
}

.dialog ul {
    padding-left: 20px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

@media (max-width: 600px) {
    .brand-tagline {
        display: none;
    }

    .button {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .chat {
        padding: 16px 12px;
    }

    .composer {
        padding: 8px 12px;
    }
}
