/* ===========================
   NICHEOS — Theme CSS
   Dark terminal aesthetic
   =========================== */

:root {
  --bg: #08080c;
  --bg-2: #0e0e14;
  --bg-3: #141420;
  --surface: #111118;
  --border: #1e1e2a;
  --fg: #e8e8f0;
  --fg-2: #8888a0;
  --fg-3: #4a4a5e;
  --accent: #c8ff00;
  --accent-dim: rgba(200, 255, 0, 0.12);
  --accent-glow: rgba(200, 255, 0, 0.06);
  --red: #ff5f5f;
  --yellow: #ffd94d;
  --green: #6bff8e;
  --ok: #c8ff00;
  --mono-font: 'Space Mono', 'Courier New', monospace;
  --body-font: 'DM Sans', system-ui, sans-serif;
  --max-w: 1080px;
  --radius: 6px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  background: rgba(8, 8, 12, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #000;
  font-family: var(--mono-font);
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
}
.logo-text {
  font-family: var(--mono-font);
  font-size: 14px;
  color: var(--fg);
  font-weight: 700;
}
.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--fg-2);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 100px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,255,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,255,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 40%, transparent 100%);
}
.hero-radial {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(200,255,0,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  margin-bottom: 32px;
}
.eyebrow-tag {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid rgba(200,255,0,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--accent-dim);
}
.hero-headline {
  font-family: var(--mono-font);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.headline-accent {
  color: var(--accent);
  font-style: italic;
}
.hero-sub {
  font-size: 18px;
  color: var(--fg-2);
  max-width: 520px;
  margin-bottom: 56px;
  line-height: 1.7;
}

/* Hero Visual */
.hero-visual {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 64px;
  flex-wrap: wrap;
  justify-content: center;
}
.terminal-window {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 380px;
  max-width: 480px;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.tb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tb-red { background: #ff5f57; }
.tb-yellow { background: #febc2e; }
.tb-green { background: #28c840; }
.tb-title {
  margin-left: 10px;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--fg-3);
}
.terminal-body {
  padding: 16px 18px;
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 2;
}
.term-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-ts { color: var(--fg-3); }
.term-ok { color: var(--ok); margin: 0 6px; }
.term-module { color: var(--accent); }
.term-muted { color: var(--fg-3); margin-top: 4px; }

/* Agent Rings */
.agent-rings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.ring { width: 120px; height: 120px; }
.ring svg { animation: spin-slow 20s linear infinite; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.ring-stats { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.rs-item { display: flex; flex-direction: column; }
.rs-val { font-family: var(--mono-font); font-size: 18px; font-weight: 700; color: var(--accent); }
.rs-key { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* Hero Proof */
.hero-proof {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}
.proof-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.proof-val { font-family: var(--mono-font); font-size: 22px; font-weight: 700; color: var(--fg); }
.proof-key { font-size: 12px; color: var(--fg-3); }
.proof-divider { width: 1px; height: 36px; background: var(--border); }

/* ---- Sections ---- */
section { padding: 96px 24px; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-label {
  display: inline-block;
  font-family: var(--mono-font);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--mono-font);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
}

/* ---- Agent Loop ---- */
.agent-loop { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.loop-diagram {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.loop-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.loop-step:hover { border-color: rgba(200,255,0,0.2); }
.loop-arrow {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.ls-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ls-content { flex: 1; }
.ls-name { font-family: var(--mono-font); font-size: 14px; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.ls-desc { font-size: 14px; color: var(--fg-2); line-height: 1.6; }
.loop-callout {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.callout-mono {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(200,255,0,0.2);
  padding: 8px 16px;
  border-radius: var(--radius);
}
.callout-msg { font-size: 14px; color: var(--fg-2); }

/* ---- Architecture ---- */
.arch-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 768px) { .arch-grid { grid-template-columns: 1fr; } }
.arch-title {
  font-family: var(--mono-font);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
  margin: 16px 0 20px;
}
.arch-body { font-size: 15px; color: var(--fg-2); line-height: 1.7; margin-bottom: 32px; }

/* Architecture Bars */
.arch-bars { display: flex; flex-direction: column; gap: 16px; }
.ab-row { display: flex; align-items: center; gap: 12px; }
.ab-label { font-family: var(--mono-font); font-size: 12px; color: var(--fg-2); width: 150px; flex-shrink: 0; }
.ab-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.ab-fill { height: 100%; background: var(--fg-3); border-radius: 2px; }
.ab-fill-accent { background: var(--accent); }
.ab-val { font-size: 11px; color: var(--fg-3); width: 100px; text-align: right; }
.ab-val-accent { color: var(--accent); }

/* Architecture Card */
.arch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ac-header { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-3); }
.ac-badge { font-family: var(--mono-font); font-size: 11px; color: var(--fg-3); letter-spacing: 0.05em; }

/* Comparison Table */
.ac-table { padding: 0; }
.act-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: center; font-size: 13px; }
.act-row:last-child { border-bottom: none; }
.act-head { background: var(--bg-3); font-family: var(--mono-font); font-size: 10px; color: var(--fg-3); letter-spacing: 0.08em; text-transform: uppercase; }
.act-row span:first-child { color: var(--fg-2); }
.act-check, .act-x { display: flex; align-items: center; }
.act-row:not(.act-head) span:nth-child(2),
.act-row:not(.act-head) span:nth-child(3),
.act-row:not(.act-head) span:nth-child(4) {
  font-family: var(--mono-font);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Closing ---- */
.closing {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.closing-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}
.closing-title {
  font-family: var(--mono-font);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin: 16px 0 24px;
}
.closing-accent { color: var(--accent); font-style: italic; }
.closing-body {
  font-size: 17px;
  color: var(--fg-2);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

/* Closing Terminal */
.closing-terminal {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
  font-family: var(--mono-font);
  font-size: 13px;
  line-height: 2.2;
}
.ct-line { overflow: hidden; }
.ct-prompt { color: var(--fg-3); margin-right: 8px; }
.ct-cmd { color: var(--accent); }
.ct-muted { color: var(--fg-3); }
.ct-accent { color: var(--accent); }

/* ---- Footer ---- */
.footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-name { font-family: var(--mono-font); font-size: 16px; font-weight: 700; color: var(--fg); }
.footer-tagline { font-size: 14px; color: var(--fg-3); line-height: 1.6; }
.footer-meta { display: flex; gap: 8px; font-family: var(--mono-font); font-size: 11px; color: var(--fg-3); }
.footer-sep { color: var(--border); }

/* ---- Utilities ---- */
@media (max-width: 640px) {
  .hide-mobile { display: none; }
  .loop-arrow { transform: rotate(90deg); padding: 0; }
  .arch-card { display: none; }
  .proof-divider { display: none; }
  .hero-visual { flex-direction: column; }
  .agent-rings { flex-direction: row; align-items: center; }
  .ring-stats { flex-direction: row; gap: 16px; }
  .terminal-window { min-width: unset; width: 100%; }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Text selection */
::selection { background: rgba(200, 255, 0, 0.2); color: var(--fg); }

/* Smooth focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
