/* ====================================================================
   Agentic SOC Analyst — console theme
   A SOC operations console, not a marketing page: dark-only, left-
   aligned, monospace for data, one restrained accent. Severity colors
   (red/amber/blue) are reserved for real triage data and never used
   decoratively.
   ==================================================================== */

:root {
  color-scheme: dark;

  --bg:         #0d0f12;
  --surface:    #15181c;
  --surface-2:  #1b1f24;
  --border:     #262b31;
  --border-2:   #333941;
  --ink:        #e8e6e0;
  --muted:      #868d96;
  --faint:      #565c64;

  --accent:     #4fb8ac;
  --accent-ink: #06110f;

  --sev-high:   #e2585e;
  --sev-medium: #dc9a4c;
  --sev-low:    #5f95d1;

  --radius: 4px;
  --font-ui:   "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
}

.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; }
a { color: var(--accent); }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.navbar-mark {
  color: var(--accent);
  font-size: 0.7rem;
}

.navbar-links {
  display: flex;
  gap: 22px;
}

.navbar-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.navbar-links a:hover {
  color: var(--ink);
}

.navbar-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Header / hero ---------- */
.hero {
  padding: 0 0 28px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero h1 span { color: var(--accent); }

.hero p {
  max-width: 560px;
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero p strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--faint);
}

.hero-tech span:not(:last-child)::after {
  content: "/";
  margin-left: 14px;
  color: var(--border-2);
}

/* ---------- Search card (terminal prompt) ---------- */
.search-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 0;
  margin: 28px 0 10px;
}

.prompt-glyph {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
}

.search-card input[type="text"],
.search-card input[type="password"] {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 13px 12px;
}

.search-card input[type="password"] {
  flex: 0 0 160px;
  border-left: 1px solid var(--border);
}

.search-card input[type="text"]::placeholder,
.search-card input[type="password"]::placeholder {
  color: var(--faint);
}

.search-hint {
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0 0 32px;
}

.search-hint a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.search-hint a:hover { color: var(--accent); }

.search-card button {
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--border-2);
  border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-card button:hover { background: color-mix(in srgb, var(--accent) 88%, white); }

.search-card button:disabled {
  background: var(--border-2);
  color: var(--muted);
  cursor: default;
}

/* ---------- Progress panel (log stream) ---------- */
.progress-panel {
  margin-bottom: 24px;
}

.step-list {
  list-style: none;
  counter-reset: stepnum;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.step {
  counter-increment: stepnum;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--faint);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.15s ease;
}

.step.active,
.step.done {
  opacity: 1;
  transform: translateY(0);
}

.step-num::before {
  content: counter(stepnum, decimal-leading-zero);
  color: var(--border-2);
}

.step.active .step-num::before,
.step.done .step-num::before {
  color: var(--faint);
}

.step-icon {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.step-icon::before { content: "\00b7"; color: var(--border-2); }

.step.active .step-icon::before {
  content: "~";
  color: var(--accent);
  animation: step-pulse 0.9s ease-in-out infinite;
}

.step.done .step-icon::before {
  content: "\2713";
  color: var(--accent);
}

.step.active { color: var(--ink); }
.step.done { color: var(--muted); }

@keyframes step-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Error panel ---------- */
.error-panel h2 {
  color: var(--sev-high);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-ui);
}

.error-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.error-detail {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- KQL block ---------- */
.kql-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.kql-row dt {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--faint);
  margin-bottom: 8px;
}

.kql-block {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.panel h2 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 16px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px 24px;
}

.kv-grid dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  margin-bottom: 4px;
}

.kv-grid dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink);
}

.kv-grid dd.mono {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.fields-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.fields-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  margin-bottom: 6px;
}

.fields-row dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.rationale {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.rationale strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--faint);
  margin-bottom: 6px;
}

/* chip row, used for fields */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 3px 8px;
}

/* ---------- Stat tile ---------- */
.stat-tile {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat-tile .value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-tile .label {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Findings (case files) ---------- */
.findings-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.findings-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-ui);
  color: var(--ink);
}

.findings-count {
  font-family: var(--font-mono);
  color: var(--faint);
  font-size: 0.82rem;
}

.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.finding-card.confidence-high     { border-left-color: var(--sev-high); }
.finding-card.confidence-medium   { border-left-color: var(--sev-medium); }
.finding-card.confidence-low      { border-left-color: var(--sev-low); }

.finding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.finding-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: nowrap;
  padding-top: 2px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-high     { color: var(--sev-high); }
.badge-medium   { color: var(--sev-medium); }
.badge-low      { color: var(--sev-low); }

.finding-description {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.mitre-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
  padding: 3px 8px;
  margin-bottom: 14px;
}

.finding-section {
  margin-bottom: 12px;
}

.finding-section:last-child { margin-bottom: 0; }

.finding-section h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--faint);
  margin: 0 0 7px;
}

.pill-row {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pill-row li {
  position: relative;
  padding-left: 14px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.pill-row li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--faint);
}

.ioc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ioc-row li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 3px 8px;
}

.finding-notes {
  font-size: 0.85rem;
  color: var(--faint);
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ---------- About page ---------- */
.about-panel p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.about-panel p:last-child { margin-bottom: 0; }

.about-panel p strong { color: var(--ink); }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 4px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.social-icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.social-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.example-prompt {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 20px;
}

.example-prompt::before {
  content: "> ";
  color: var(--accent);
}

.pipeline {
  list-style: none;
  counter-reset: pipelinenum;
  margin: 0 0 20px;
  padding: 0;
}

.pipeline li {
  counter-increment: pipelinenum;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--ink);
}

.pipeline li:last-child { border-bottom: none; }

.pipeline li::before {
  content: counter(pipelinenum, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
  flex-shrink: 0;
}

.demo-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.demo-note strong { color: var(--ink); }

.credit-list {
  margin: 0;
}

.credit-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.credit-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credit-item:first-child {
  padding-top: 0;
}

.credit-item h3 {
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.credit-item p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.credit-item p:last-child {
  margin-bottom: 0;
}

/* ---------- History page ---------- */
.history-summary {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--faint);
  margin: -8px 0 20px;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--faint);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.history-question {
  color: var(--muted);
}

.history-question::before { content: "\201c"; }
.history-question::after { content: "\201d"; }

/* ---------- Empty state ---------- */
.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 20px 0;
}
