/* ==========================================================================
   Aegisnode Design System — Dark Mode Only
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg: #0a0f1a;
  --surface: #111827;
  --surface-alt: #151c2c;
  --border: #1f2937;
  --border-subtle: #1a2234;
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.1);
  --cyan-hover: #22d3ee;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
  --critical: #dc2626;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Layout */
  --max-w: 1200px;
  --max-w-narrow: 800px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; }
input, textarea { font: inherit; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container--narrow {
  max-width: var(--max-w-narrow);
}

.section {
  padding-block: var(--sp-20);
}

.section--sm {
  padding-block: var(--sp-12);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-cta {
  background: var(--cyan);
  color: var(--bg) !important;
  font-weight: 600 !important;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem !important;
  transition: background 0.2s, transform 0.15s;
}

.nav-cta:hover {
  background: var(--cyan-hover);
  transform: translateY(-1px);
}

.nav-cta:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--sp-2);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--cyan);
  color: var(--bg);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
}

.btn--primary:hover {
  background: var(--cyan-hover);
  transform: translateY(-1px);
}

.btn--outline {
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
}

.btn--outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn--lg {
  padding: 0.9rem 2.25rem;
  font-size: 1rem;
}

.btn--sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: rgba(6, 182, 212, 0.2);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--cyan-dim);
  color: var(--cyan);
}

.badge--success { background: rgba(34,197,94,0.1); color: var(--success); }
.badge--warning { background: rgba(234,179,8,0.1); color: var(--warning); }
.badge--error { background: rgba(239,68,68,0.1); color: var(--error); }
.badge--critical { background: rgba(220,38,38,0.1); color: var(--critical); }
.badge--neutral { background: rgba(107,114,128,0.1); color: var(--text-muted); }

/* --- Severity --- */
.severity-critical { color: var(--critical); }
.severity-high { color: var(--error); }
.severity-medium { color: var(--warning); }
.severity-low { color: var(--cyan); }
.severity-info { color: var(--text-muted); }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-16) 0 var(--sp-8);
  background: var(--bg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-12);
  margin-bottom: var(--sp-12);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--sp-3);
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: var(--sp-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.footer-bottom a {
  color: var(--text-faint);
  transition: color 0.2s;
}

.footer-bottom a:hover { color: var(--text-muted); }

/* --- Utility --- */
.mono { font-family: var(--font-mono); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0f1a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-8);
    gap: var(--sp-6);
    z-index: 1001;
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex !important;
  }

  .nav-links a {
    font-size: 1.2rem;
    color: var(--text);
    padding: var(--sp-3) var(--sp-6);
  }

  .nav-links .nav-cta {
    margin-top: var(--sp-4);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .section { padding-block: var(--sp-12); }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Selection */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--text);
}
