/* ═══════════════════════════════════════════════════════════════════
   style.css — Server UI styles (showcase page only)
   Chat widget styles are in chat.css.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500&display=swap');

:root {
  --bg:          #f8f7f4;
  --surface:     #ffffff;
  --border:      #e2dfd8;
  --border-dark: #c8c4bc;
  --text:        #18181a;
  --text-muted:  #7a7872;
  --accent:      #5c7a62;   /* muted sage green */
  --accent-lt:   #eef3ef;
  --mono:        'IBM Plex Mono', monospace;
  --sans:        'IBM Plex Sans', sans-serif;
  --serif:       'Instrument Serif', Georgia, serif;
  --radius:      6px;
  --chat-w:      380px;
  --chat-h:      520px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ──────────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark { display: flex; flex-direction: column; gap: 1px; }

.wordmark-main {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.wordmark-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-nav { display: flex; gap: 24px; }

.header-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.header-nav a:hover { color: var(--accent); }

/* ── MAIN ────────────────────────────────────────────────────────── */

main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 32px 40px;
  width: 100%;
}

/* ── ABOUT ───────────────────────────────────────────────────────── */

.about { margin-bottom: 64px; }

.about-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text);
}

.about-title em { font-style: italic; color: var(--accent); }

.about-desc {
  font-size: 1rem;
  line-height: 1.75;
  color: #444;
  max-width: 600px;
  margin-bottom: 28px;
}

.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; }

.tech-stack span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

/* ── STATS ───────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: normal;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.last-ingest {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.last-ingest-label { color: var(--accent); font-weight: 500; }

/* ── FOOTER ──────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 40;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 7px 16px;
  border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.upload-label:hover { border-color: var(--accent); color: var(--accent); }

.upload-icon { font-size: 0.9rem; line-height: 1; }

#csv-input { display: none; }

.upload-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s;
}

.upload-btn:disabled          { opacity: 0.35; cursor: not-allowed; }
.upload-btn:not(:disabled):hover { opacity: 0.85; }

.upload-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  display: none;
}

.upload-status.ok      { background: #edfaee; color: #2d6e35; display: block; }
.upload-status.error   { background: #fdecea; color: #c0392b; display: block; }
.upload-status.loading { background: var(--accent-lt); color: var(--accent); display: block; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .stat-grid      { grid-template-columns: repeat(2, 1fr); }
  .header-inner   { padding: 14px 20px; }
  main            { padding: 48px 20px 32px; }
  .footer-inner   { padding: 12px 20px; }
}
