/* Sankofa — Amber/Gold + Green on Dark Stone */

:root {
    --gold: #d4a84b;
    --gold-light: #e8c97d;
    --gold-dim: #b8860b;
    --green: #4a8c5c;
    --green-light: #6aad7e;
    --stone-dark: #1a1714;
    --stone: #2a2520;
    --stone-mid: #3a3530;
    --stone-light: #504a44;
    --text: #e8e0d4;
    --text-dim: #a89e90;
    --text-bright: #f5f0e8;
    --danger: #c0392b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--stone-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--text-bright);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--stone);
    border-bottom: 1px solid var(--stone-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.brand-icon { font-size: 1.8rem; }

.nav-links { display: flex; gap: 1.5rem; }

.nav-link {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--gold); }

/* ---- Hero ---- */
.hero {
    text-align: center;
    padding: 5rem 2rem 3rem;
    background: linear-gradient(180deg, var(--stone) 0%, var(--stone-dark) 100%);
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.hero .tagline {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.hero .description {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--text);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gold);
    color: var(--stone-dark);
}
.btn-primary:hover { background: var(--gold-light); color: var(--stone-dark); }

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
}
.btn-secondary:hover { background: var(--gold-dim); color: var(--text-bright); }

/* ---- Topics Grid ---- */
.section { padding: 3rem 2rem; max-width: 1100px; margin: 0 auto; }
.section-title {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.topic-card {
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}
.topic-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
}
.topic-card h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}
.topic-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ---- Stats ---- */
.stats-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.stat {
    text-align: center;
}
.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* ---- Chat ---- */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.chat-header {
    text-align: center;
    padding: 1.5rem 0;
}
.chat-header h1 { font-size: 2rem; color: var(--gold); }
.chat-header p { color: var(--text-dim); font-style: italic; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.message-user {
    align-self: flex-end;
    background: var(--gold-dim);
    color: var(--text-bright);
    border-bottom-right-radius: 4px;
}

.message-assistant {
    align-self: flex-start;
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-bottom-left-radius: 4px;
}

.message-sources {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--stone-light);
    font-size: 0.8rem;
    color: var(--text-dim);
}
.message-sources strong { color: var(--green-light); }

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--stone-light);
}

.chat-input {
    flex: 1;
    padding: 0.85rem 1rem;
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    resize: none;
}
.chat-input:focus { border-color: var(--gold-dim); }
.chat-input::placeholder { color: var(--text-dim); }

.chat-send {
    padding: 0.85rem 1.5rem;
    background: var(--gold);
    color: var(--stone-dark);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-send:hover { background: var(--gold-light); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-topics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

.topic-btn {
    padding: 0.4rem 0.8rem;
    background: var(--stone-mid);
    border: 1px solid var(--stone-light);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.topic-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 0.75rem 1.25rem;
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-radius: 12px;
    color: var(--text-dim);
    font-style: italic;
}

/* ---- Sources ---- */
.sources-list { display: flex; flex-direction: column; gap: 1rem; }
.source-card {
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-radius: 8px;
    padding: 1.25rem;
}
.source-card h3 { color: var(--gold); margin-bottom: 0.25rem; }
.source-card .author { color: var(--green-light); font-size: 0.9rem; }
.source-card .chunks { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.5rem; }

/* ---- Upload ---- */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.form-input, .form-select, .form-textarea {
    padding: 0.75rem 1rem;
    background: var(--stone);
    border: 1px solid var(--stone-light);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold-dim);
}
.form-textarea { resize: vertical; min-height: 80px; }

.upload-status {
    padding: 1rem;
    border-radius: 6px;
    display: none;
}
.upload-status.success { display: block; background: rgba(74,140,92,0.2); border: 1px solid var(--green); }
.upload-status.error { display: block; background: rgba(192,57,43,0.2); border: 1px solid var(--danger); }

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--stone-light);
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .nav-links { gap: 1rem; }
    .hero h1 { font-size: 2.5rem; }
    .hero .tagline { font-size: 1.1rem; }
    .topics-grid { grid-template-columns: 1fr; }
    .stats-row { gap: 1rem; }
    .message { max-width: 95%; }
    .chat-container { padding: 1rem; }
}
