/**
 * NOESIS v3.0 — Cyber-Tactile Obsidian Stylesheet
 * Strictly under 400 lines (Tear Rule #24 compliant)
 */

:root {
  --bg-void: #07080b;
  --bg-surface: #0e1017;
  --bg-card: #141722;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(234, 179, 8, 0.4);
  
  --gold: #eab308;
  --emerald: #10b981;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --rose: #f43f5e;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-tactile: 0 8px 30px -4px rgba(0, 0, 0, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 10% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(234, 179, 8, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.mono { font-family: var(--font-mono); }

.text-gold { color: var(--gold); }
.text-emerald { color: var(--emerald); }
.text-violet { color: var(--violet); }
.text-cyan { color: var(--cyan); }
.text-rose { color: var(--rose); }

/* Navigation */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 8, 11, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { width: 34px; height: 34px; animation: spinSlow 30s linear infinite; }
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.brand-name {
  font-size: 1.2rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 40%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-badge {
  font-size: 0.65rem; padding: 2px 7px; border-radius: 999px;
  background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--gold); font-family: var(--font-mono); font-weight: 600;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; list-style: none; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.15s; }
.nav-link:hover { color: #ffffff; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.5rem 1.1rem; border-radius: var(--radius-md); font-size: 0.875rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s; text-decoration: none; border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #09090b;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(234, 179, 8, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text-main); border-color: var(--border-subtle); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); }
.btn-k-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 0.35rem 0.75rem;
  font-size: 0.75rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle); color: var(--text-muted); cursor: pointer;
}
.btn-k-badge:hover { border-color: var(--gold); color: var(--gold); }

/* Hero */
.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border-radius: 999px; background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd; font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; transform: scale(1.15); } }

.hero-title {
  font-size: 3.25rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em;
  margin-bottom: 1.25rem; max-width: 980px; margin-left: auto; margin-right: auto;
}
.hero-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lead { font-size: 1.15rem; color: var(--text-muted); max-width: 820px; margin: 0 auto 2.25rem; line-height: 1.6; }
.hero-cta { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3.5rem; flex-wrap: wrap; }
.hero-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; max-width: 1040px; margin: 0 auto; }
.metric-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.25rem; text-align: left;
}
.metric-val { font-size: 1.75rem; font-weight: 700; color: #fff; font-family: var(--font-mono); }
.metric-lbl { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* Bento Section */
.section { padding: 4rem 0; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-badge { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--gold); margin-bottom: 0.4rem; }
.section-title { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.section-desc { color: var(--text-muted); font-size: 0.95rem; max-width: 680px; margin: 0 auto; }

.bento-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.25rem; }
.bento-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 1.75rem; display: flex; flex-direction: column;
  transition: all 0.2s ease;
}
.bento-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.2); box-shadow: var(--shadow-tactile); }
.col-span-8 { grid-column: span 8; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

.bento-tag {
  align-self: flex-start; font-size: 0.7rem; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted); margin-bottom: 1rem;
}
.bento-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.6rem; }
.bento-body { color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; margin-bottom: 1.25rem; flex-grow: 1; }
.bento-preview {
  background: var(--bg-card); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md); padding: 0.85rem; font-size: 0.775rem; font-family: var(--font-mono);
}

/* Cockpit Box */
.cockpit-box {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-tactile);
}
.cockpit-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; background: rgba(14, 16, 23, 0.95);
  border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; gap: 0.75rem;
}
.cockpit-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.cockpit-tab {
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
  font-size: 0.825rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.cockpit-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.cockpit-tab.active { background: var(--bg-card); border-color: rgba(255, 255, 255, 0.15); color: #fff; }
.cockpit-status { display: flex; align-items: center; gap: 10px; font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); }
.cockpit-body { min-height: 440px; background: var(--bg-card); }
.tab-pane { display: none; padding: 1.25rem; }
.tab-pane.active { display: block; }

/* DAG Layout */
.dag-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1rem; min-height: 420px; }
.dag-canvas-container {
  background: #090a10; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
}
.dag-svg { width: 100%; height: 400px; }
.dag-node { cursor: pointer; transition: filter 0.15s; }
.dag-node:hover { filter: brightness(1.25); }
.dag-sidebar {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.25rem; font-size: 0.825rem;
}

/* Crucible Lanes */
.crucible-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.lane-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.15rem;
}
.lane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.lane-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; font-family: var(--font-mono); }
.lane-golden { background: rgba(234, 179, 8, 0.15); color: var(--gold); border: 1px solid rgba(234, 179, 8, 0.35); }
.lane-pass { background: rgba(16, 185, 129, 0.15); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.35); }

/* Swarm Grid */
.swarm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem; max-height: 420px; overflow-y: auto; padding-right: 0.4rem;
}
.agent-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 0.85rem;
}
.agent-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.agent-title { font-size: 0.825rem; font-weight: 600; font-family: var(--font-mono); }
.agent-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }

/* Terminal */
.terminal-box { background: #06070a; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); font-family: var(--font-mono); }
.terminal-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; background: #0d0f17; border-bottom: 1px solid var(--border-subtle); }
.terminal-dots { display: flex; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-red { background: #ef4444; } .dot-yellow { background: #eab308; } .dot-green { background: #22c55e; }
.terminal-screen { padding: 1rem; height: 320px; overflow-y: auto; font-size: 0.8rem; line-height: 1.65; }
.log-line { display: flex; gap: 10px; margin-bottom: 3px; }
.log-time { color: var(--text-dim); }
.log-agent { color: var(--cyan); font-weight: 600; }
.log-tool { color: var(--gold); }
.log-success { color: var(--emerald); }
.terminal-controls { display: flex; gap: 0.5rem; padding: 0.65rem 1rem; background: #0a0b12; border-top: 1px solid var(--border-subtle); }

/* Command Palette */
.cmd-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px); z-index: 200; display: none;
  align-items: flex-start; justify-content: center; padding-top: 15vh;
}
.cmd-backdrop.open { display: flex; }
.cmd-modal {
  width: 100%; max-width: 580px; background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8); overflow: hidden;
}
.cmd-input-wrap { display: flex; align-items: center; padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--border-subtle); gap: 10px; }
.cmd-input { width: 100%; background: transparent; border: none; outline: none; color: #fff; font-size: 1rem; font-family: var(--font-sans); }
.cmd-list { max-height: 300px; overflow-y: auto; padding: 0.4rem; list-style: none; }
.cmd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.85rem; border-radius: var(--radius-md); cursor: pointer;
  color: var(--text-muted); font-size: 0.85rem;
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg-card); color: #fff; }
.cmd-badge { font-size: 0.65rem; font-family: var(--font-mono); padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }

/* Footer */
.footer { border-top: 1px solid var(--border-subtle); padding: 2.5rem 0; margin-top: 4rem; background: #050608; color: var(--text-dim); font-size: 0.825rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 1024px) {
  .hero-title { font-size: 2.6rem; }
  .col-span-8, .col-span-4, .col-span-6 { grid-column: span 12; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .crucible-grid { grid-template-columns: repeat(2, 1fr); }
  .dag-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .nav-links { display: none; }
  .hero-metrics { grid-template-columns: 1fr; }
  .crucible-grid { grid-template-columns: 1fr; }
}
