:root {
    --bg: #071019;
    --panel: rgba(12, 24, 36, 0.86);
    --panel-strong: #0d1d2c;
    --border: rgba(255, 255, 255, 0.10);
    --text: #eef6fb;
    --muted: #9eafbd;
    --accent: #d6b56c;
    --accent-light: #f1d991;
    --blue: #3ba9ff;
    --green: #5bd6a0;
    --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 20% 0%, rgba(46, 111, 160, 0.18), transparent 34%),
        radial-gradient(circle at 90% 15%, rgba(214, 181, 108, 0.12), transparent 30%),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.background-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.12;
    pointer-events: none;
}

.glow-one {
    top: 30%;
    left: -120px;
    background: var(--blue);
}

.glow-two {
    right: -100px;
    bottom: 10%;
    background: var(--accent);
}

.topbar {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-icon,
.assistant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #1b2026;
    background: linear-gradient(145deg, var(--accent-light), var(--accent));
    box-shadow: 0 8px 25px rgba(214, 181, 108, 0.18);
    font-size: 24px;
}

.brand strong {
    display: block;
    font-size: 15px;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.4px;
}

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

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

main {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    min-height: auto;
    height: calc(100vh - 170px);
    max-height: 650px;

    display: grid;
    grid-template-columns: 1fr 0.9fr;
    gap: 50px;
    align-items: center;

    padding: 25px 0 35px;
}

.hero h1 {
    max-width: 720px;
    margin: 14px 0 18px;
    font-size: clamp(46px, 5vw, 68px);
    line-height: 0.98;
    letter-spacing: -2.5px;
}
.hero-text {
    max-width: 620px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.feature-row {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    margin-top: 25px;
}

.feature {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 12px 13px;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.hero-image-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    border-radius: 30px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: var(--shadow);
    transform: rotate(1deg);
    background: #111;
}

.hero-image-card img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    display: block;
}
.hero-image-card img {
    width: 100%;
    height: 380px;
    display: block;
    object-fit: cover;
}

.image-caption {
    position: absolute;
    top: 1px;
    left: 20px;
    right: 20px;

    padding: 14px 18px;

    background: rgba(10, 15, 20, 0.82);
    backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;

    color: white;
}

.image-caption span {
    color: var(--accent-light);
    font-size: 23px;
}

.image-caption strong,
.image-caption small {
    display: block;
}

.image-caption strong {
    font-size: 12px;
}

.image-caption small {
    color: var(--muted);
    margin-top: 3px;
    font-size: 10px;
}

.assistant-layout {
    display: grid;
    grid-template-columns: 0.76fr 1.24fr;
    gap: 24px;
    align-items: stretch;
}

.info-panel,
.chat-card,
.sources-section {
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.info-panel {
    overflow: hidden;
    border-radius: 25px;
}

.panel-image {
    height: 280px;
    overflow: hidden;
}

.panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.info-panel:hover .panel-image img {
    transform: scale(1.04);
}

.panel-content {
    padding: 26px;
}

.panel-content h2 {
    margin: 10px 0;
    font-size: 28px;
}

.panel-content p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 20px;
}

.tech-stack span {
    padding: 6px 9px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(255,255,255,0.035);
    border-radius: 8px;
    color: #c8d7e0;
    font-size: 10px;
}

.chat-card {
    border-radius: 25px;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.chat-header .assistant-avatar {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.chat-header h2 {
    margin: 0;
    font-size: 15px;
}

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

.online-badge {
    margin-left: auto;
    font-size: 9px;
    color: var(--green);
    border: 1px solid rgba(91,214,160,0.25);
    background: rgba(91,214,160,0.06);
    padding: 6px 8px;
    border-radius: 999px;
    letter-spacing: 1px;
}

.chat-messages {
    flex: 1;
    min-height: 350px;
    max-height: 580px;
    overflow-y: auto;
    padding: 24px;
}

.welcome-message {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--muted);
}

.welcome-icon {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: rgba(214,181,108,0.08);
    border: 1px solid rgba(214,181,108,0.22);
    color: var(--accent-light);
    font-size: 27px;
}

.welcome-message h3 {
    margin: 14px 0 5px;
    color: var(--text);
}

.welcome-message p {
    max-width: 420px;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
}

.suggestions button {
    color: #c8d7e0;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.suggestions button:hover {
    color: var(--accent-light);
    border-color: rgba(214,181,108,0.35);
    transform: translateY(-1px);
}

.message {
    max-width: 90%;
    margin-bottom: 18px;
    animation: appear 0.25s ease;
}

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

.message.user {
    margin-left: auto;
}

.message-label {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.message-bubble {
    border-radius: 16px;
    padding: 13px 15px;
    line-height: 1.65;
    font-size: 13px;
    white-space: pre-wrap;
}

.message.user .message-bubble {
    background: rgba(59,169,255,0.10);
    border: 1px solid rgba(59,169,255,0.17);
}

.message.assistant .message-bubble {
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
}

.question-form {
    margin: 0 18px 14px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: rgba(0,0,0,0.16);
    overflow: hidden;
}

.question-form textarea {
    width: 100%;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    padding: 15px 16px 7px;
    font: inherit;
    font-size: 13px;
}

.question-form textarea::placeholder {
    color: #718391;
}

.form-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 7px 7px 14px;
}

#characterCount {
    color: #657783;
    font-size: 9px;
}

#askButton {
    border: 0;
    cursor: pointer;
    border-radius: 11px;
    padding: 9px 12px;
    display: flex;
    gap: 9px;
    align-items: center;
    color: #192026;
    font-weight: 800;
    font-size: 10px;
    background: linear-gradient(145deg, var(--accent-light), var(--accent));
}

#askButton:disabled {
    opacity: 0.55;
    cursor: wait;
}

.send-icon {
    font-size: 14px;
}

.disclaimer {
    padding: 0 20px 20px;
    color: #718391;
    font-size: 9px;
    line-height: 1.6;
    text-align: center;
}

.disclaimer strong {
    color: #a8b7c1;
}

.sources-section {
    margin: 24px 0 70px;
    padding: 26px;
    border-radius: 25px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
}

.section-heading h2 {
    margin: 8px 0 0;
    font-size: 25px;
}

.source-count {
    color: var(--muted);
    font-size: 11px;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.source-card {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.025);
    border-radius: 15px;
    padding: 16px;
}

.source-card .source-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    color: var(--accent-light);
    font-size: 10px;
}

.source-card p {
    margin: 0;
    color: #aebdc7;
    line-height: 1.6;
    font-size: 11px;
}

.hidden {
    display: none !important;
}

.loading {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.loading span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--muted);
    animation: bounce 1s infinite ease-in-out;
}

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

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

footer {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 35px;
    color: #61717d;
    font-size: 10px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

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

    .hero-image-card img {
        height: 380px;
    }

    .assistant-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .topbar,
    main,
    footer {
        width: min(100% - 24px, 1240px);
    }

    .status-pill {
        display: none;
    }

    .hero {
        padding: 30px 0 50px;
    }

    .hero h1 {
        font-size: 44px;
        letter-spacing: -2px;
    }

    .hero-image-card img {
        height: 300px;
    }

    .feature-row {
        display: grid;
        grid-template-columns: 1fr;
    }

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

    footer {
        flex-direction: column;
    }
}

@media (max-height: 800px) and (min-width: 769px) {
    .hero {
        min-height: calc(100vh - 95px);
        padding: 25px 0 30px;
        gap: 40px;
    }

    .hero h1 {
        font-size: clamp(44px, 4.8vw, 64px);
        margin: 12px 0 16px;
    }

    .hero-text {
        font-size: 15px;
        line-height: 1.5;
    }

    .feature-row {
        margin-top: 20px;
    }

    .hero-image-card {
        height: min(58vh, 500px);
    }
}