/* ============================================================
   IERAHKWA SOVEREIGN DESIGN SYSTEM v5.5.0
   Ierahkwa Ne Kanienke Government and its successors
   Military-grade dark theme — Zero external dependencies
   ============================================================ */

/* --- Root Variables --- */
:root {
  --matrix-green: #00FF41;
  --matrix-cyan: #00e5ff;
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1117;
  --bg-card: rgba(13, 17, 23, 0.92);
  --border-glow: rgba(0, 255, 65, 0.4);
  --text-primary: #f0f6fc;
  --text-secondary: #c9d1d9;
  --text-dim: #8b949e;
  --gold: #FFD700;
  --danger: #ff5252;
  --font-mono: 'Courier New', 'Fira Code', monospace;
  --radius: 8px;
  --transition: 0.3s ease;
  --glow-sm: 0 0 8px rgba(0, 255, 65, 0.4), 0 0 2px rgba(0, 255, 65, 0.8);
  --glow-md: 0 0 20px rgba(0, 255, 65, 0.5), 0 0 4px rgba(0, 255, 65, 0.9);
  --glow-lg: 0 0 40px rgba(0, 255, 65, 0.6), 0 0 8px rgba(0, 255, 65, 1);
  --glow-gold: 0 0 8px rgba(255, 215, 0, 0.5), 0 0 2px rgba(255, 215, 0, 0.9);
  --glow-cyan: 0 0 8px rgba(0, 229, 255, 0.5), 0 0 2px rgba(0, 229, 255, 0.9);
  --glow-red: 0 0 8px rgba(255, 82, 82, 0.5), 0 0 2px rgba(255, 82, 82, 0.9);
  --neon-text: 0 0 7px rgba(0, 255, 65, 0.3), 0 0 3px rgba(0, 255, 65, 0.5);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--matrix-green); text-decoration: none; transition: all var(--transition); text-shadow: 0 0 4px rgba(0, 255, 65, 0.3); }
a:hover { text-shadow: var(--glow-sm); color: #4dff7c; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { color: var(--text-primary); line-height: 1.2; text-shadow: var(--neon-text); }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); color: var(--matrix-green); text-shadow: var(--glow-md); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); color: var(--matrix-green); text-shadow: var(--glow-sm); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
p, li, td, th, label, span, dd, dt { color: var(--text-secondary); }

/* --- Navigation --- */
.nav-sovereign {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(10, 14, 23, 0.95);
  border-bottom: 1px solid var(--border-glow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-sovereign .nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--matrix-green);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-sovereign .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-sovereign .nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--transition);
  text-shadow: 0 0 3px rgba(201, 209, 217, 0.2);
}

.nav-sovereign .nav-links a:hover,
.nav-sovereign .nav-links a.active {
  color: var(--matrix-green);
  text-shadow: var(--glow-sm);
}

.nav-sovereign .menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-glow);
  color: var(--matrix-green);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  width: 100%;
  padding: 5rem 2rem 4rem;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1923 50%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-glow);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(0, 255, 65, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-section h1 {
  color: var(--matrix-green);
  text-shadow: var(--glow-lg);
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.hero-section p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
  text-shadow: 0 0 6px rgba(201, 209, 217, 0.15);
}

/* --- Badge (Sovereignty Seal) --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: 100px;
  background: rgba(0, 255, 65, 0.12);
  color: var(--matrix-green);
  border: 1px solid var(--border-glow);
}

.badge--gold { background: rgba(255, 215, 0, 0.15); color: var(--gold); border-color: rgba(255, 215, 0, 0.4); text-shadow: var(--glow-gold); }
.badge--danger { background: rgba(255, 82, 82, 0.15); color: var(--danger); border-color: rgba(255, 82, 82, 0.4); text-shadow: var(--glow-red); }
.badge--cyan { background: rgba(0, 229, 255, 0.15); color: var(--matrix-cyan); border-color: rgba(0, 229, 255, 0.4); text-shadow: var(--glow-cyan); }

/* --- Stat Card --- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-md);
}

.stat-card .stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--matrix-green);
  text-shadow: var(--glow-lg);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 4px rgba(201, 209, 217, 0.15);
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Feature Card --- */
.feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity var(--transition);
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.06);
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--glow-md);
}

.feature-card:hover::after { opacity: 1; }

.feature-card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  color: var(--matrix-green);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-shadow: var(--glow-sm);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  text-shadow: 0 0 3px rgba(201, 209, 217, 0.1);
}

/* --- Button --- */
.btn-sovereign {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--bg-primary);
  background: var(--matrix-green);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn-sovereign:hover {
  box-shadow: var(--glow-lg);
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.btn-sovereign--outline {
  background: transparent;
  color: var(--matrix-green);
  border: 1px solid var(--matrix-green);
}

.btn-sovereign--outline:hover { background: rgba(0, 255, 65, 0.1); }

/* --- Footer --- */
.footer-sovereign {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-glow);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-shadow: 0 0 3px rgba(201, 209, 217, 0.1);
}

.footer-sovereign .sovereignty-statement {
  color: var(--matrix-green);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  text-shadow: var(--glow-sm);
}

/* --- Section Utility --- */
.section { padding: 3rem 2rem; max-width: 1400px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 2rem; color: var(--matrix-green); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 8px rgba(0,255,65,0.2); } 50% { box-shadow: 0 0 24px rgba(0,255,65,0.5); } }
@keyframes matrixFade { 0% { opacity: 0; transform: translateY(-10px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

.animate { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate.visible { opacity: 1; transform: translateY(0); }

/* --- Light Theme Override --- */
body.theme-light {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-glow: rgba(0, 100, 30, 0.2);
  --text-primary: #1a1a2e;
  --text-secondary: #555;
}

/* --- GAAD Accessibility --- */
:focus-visible {
  outline: 2px solid var(--matrix-green);
  outline-offset: 3px;
}

.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;
}

@media (forced-colors: active) {
  .feature-card, .stat-card { border: 2px solid ButtonText; }
  .btn-sovereign { border: 2px solid ButtonText; }
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
  .card-grid { padding: 1.5rem; gap: 1rem; }
  .hero-section { padding: 3.5rem 1.5rem 3rem; }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
  .nav-sovereign .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border-glow); padding: 1rem 2rem; gap: 1rem; }
  .nav-sovereign .nav-links.open { display: flex; }
  .nav-sovereign .menu-toggle { display: block; }
  .card-grid { grid-template-columns: 1fr; padding: 1rem; }
  .hero-section { padding: 3rem 1rem 2.5rem; }
  .section { padding: 2rem 1rem; }
}

/* --- Large Screens --- */
@media (min-width: 1400px) {
  .card-grid { max-width: 1600px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .animate { opacity: 1; transform: none; }
}

/* --- Neon Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 65, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 65, 0.6); }

/* --- Neon Utility Classes --- */
.neon-green { color: var(--matrix-green); text-shadow: var(--glow-sm); }
.neon-gold { color: var(--gold); text-shadow: var(--glow-gold); }
.neon-cyan { color: var(--matrix-cyan); text-shadow: var(--glow-cyan); }
.neon-red { color: var(--danger); text-shadow: var(--glow-red); }
.neon-pulse { animation: pulseGlow 2s ease-in-out infinite; }

/* --- Stats Grid (override inline styles) --- */
.stats, .stats-grid, .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Section Panel Override --- */
.sec-panel, .section-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 1rem 0;
  color: var(--text-secondary);
}

.sec-panel h2, .sec-panel h3, .section-panel h2, .section-panel h3 {
  color: var(--matrix-green);
  text-shadow: var(--glow-sm);
}

/* --- Ensure all text is readable --- */
body, body * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Print --- */
@media print {
  body { background: #fff; color: #000; }
  .nav-sovereign, .footer-sovereign, .menu-toggle, #matrix-canvas { display: none !important; }
  .feature-card, .stat-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  a { color: #000; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}
