@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900;1,14..32,400&family=Cairo:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ==========================================================================
   AARKAM SOVEREIGN DESIGN SYSTEM v2.0
   "Sovereign Precision" — Clean, Trustworthy, Premium Enterprise
   Light/Dark Section Cadence · Restrained Single-Accent Color
   ========================================================================== */

:root {
  /* ── Brand Palette ── */
  --aarkam-emerald:       #10B981;
  --aarkam-emerald-light: #34D399;
  --aarkam-emerald-dark:  #022c22;
  --aarkam-emerald-50:    #ECFDF5;
  --aarkam-emerald-100:   #D1FAE5;
  --aarkam-emerald-900:   #064E3B;
  --aarkam-ice-cyan:      #06B6D4;
  --aarkam-cyan-light:    #67E8F9;
  --aarkam-gold-amber:    #F59E0B;
  --aarkam-royal-indigo:  #6366F1;
  --aarkam-electric-purple: #A855F7;
  --aarkam-teal:          #14B8A6;

  /* ── Dark Surfaces (Real Contrast Between Sections) ── */
  --surface-black:        #000000;
  --surface-deep:         #050A12;
  --surface-dark:         #0B1120;
  --surface-elevated:     #111827;
  --surface-card:         #0F172A;
  --surface-card-hover:   #1E293B;

  /* ── Light Surfaces ── */
  --surface-white:        #FFFFFF;
  --surface-light:        #F8FAFC;
  --surface-light-alt:    #F1F5F9;

  /* ── Border & Plate ── */
  --border-dark:          rgba(255, 255, 255, 0.08);
  --border-dark-hover:    rgba(255, 255, 255, 0.16);
  --border-emerald:       rgba(16, 185, 129, 0.3);
  --border-emerald-hover: rgba(16, 185, 129, 0.5);
  --border-light:         #E2E8F0;
  --border-light-hover:   #CBD5E1;

  /* ── Typography ── */
  --text-white:           #FFFFFF;
  --text-100:             #F1F5F9;
  --text-200:             #E2E8F0;
  --text-300:             #CBD5E1;
  --text-400:             #94A3B8;
  --text-500:             #64748B;
  --text-600:             #475569;
  --text-700:             #334155;
  --text-800:             #1E293B;
  --text-900:             #0F172A;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--surface-black);
  scroll-padding-top: 5rem; /* offset for sticky header */
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--surface-black);
  color: var(--text-white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.font-ar {
  font-family: 'Cairo', sans-serif;
}

/* ==========================================================================
   SECTION SURFACE SYSTEM — Light / Dark Cadence
   Hero(dark) → Sectors(dark) → Pillars(LIGHT) → Calculator(dark)
   → Ecosystem(dark) → Compliance(LIGHT) → Docs(dark) → CTA(dark)
   ========================================================================== */

/* ── Dark Sections ── */
.section-hero {
  background-color: var(--surface-black);
  position: relative;
}

.section-sectors {
  background-color: var(--surface-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.section-calculator {
  background-color: var(--surface-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.section-ecosystem {
  background-color: var(--surface-black);
}

.section-docs {
  background-color: var(--surface-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.section-cta {
  background-color: var(--surface-black);
  border-top: 1px solid var(--border-emerald);
}

/* ── Light Sections (Trust Contrast Breaks) ── */
.section-pillars {
  background-color: var(--surface-white);
  color: var(--text-900);
}

.section-compliance {
  background-color: var(--surface-light);
  color: var(--text-900);
}

/* ==========================================================================
   CARD SYSTEM
   ========================================================================== */

/* ── Glass Card (for dark sections) ── */
.card-glass {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8) 0%, rgba(11, 17, 32, 0.95) 100%);
  border: 1px solid var(--border-dark);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card-glass:hover {
  border-color: var(--border-dark-hover);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

/* Color accent variants (left border) */
.card-glass-emerald  { border-left: 3px solid var(--aarkam-emerald); }
.card-glass-cyan     { border-left: 3px solid var(--aarkam-ice-cyan); }
.card-glass-amber    { border-left: 3px solid var(--aarkam-gold-amber); }
.card-glass-indigo   { border-left: 3px solid var(--aarkam-royal-indigo); }
.card-glass-purple   { border-left: 3px solid var(--aarkam-electric-purple); }
.card-glass-teal     { border-left: 3px solid var(--aarkam-teal); }

/* ── Solid Card (for light sections) ── */
.card-solid {
  background-color: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card-solid:hover {
  border-color: var(--border-light-hover);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* Color accent variants (left border) for solid cards */
.card-solid-emerald  { border-left: 3px solid var(--aarkam-emerald); }
.card-solid-cyan     { border-left: 3px solid var(--aarkam-ice-cyan); }
.card-solid-purple   { border-left: 3px solid var(--aarkam-electric-purple); }

/* ── Outline Card (minimal, for secondary content) ── */
.card-outline {
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: 1rem;
  transition: border-color 0.25s ease;
}

.card-outline:hover {
  border-color: var(--border-emerald-hover);
}

/* ==========================================================================
   BUTTON SYSTEM — Restrained, Authoritative
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background-color: var(--aarkam-emerald);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #059669;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background-color: transparent;
  color: var(--text-200);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--border-dark-hover);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--aarkam-emerald);
  color: var(--aarkam-emerald);
}

/* Button variant for light sections */
.btn-secondary-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background-color: transparent;
  color: var(--text-700);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--border-light-hover);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.btn-secondary-light:hover {
  border-color: var(--aarkam-emerald);
  color: var(--aarkam-emerald);
}

/* ==========================================================================
   INTERACTIVE TERMINAL WINDOW
   ========================================================================== */
.terminal-window {
  background-color: #050914;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 30px -5px rgba(16, 185, 129, 0.08);
}

.terminal-header {
  background-color: #0b1122;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-tab-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  color: var(--text-400);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-tab-btn:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.05);
}

.terminal-tab-btn.active {
  color: var(--aarkam-emerald);
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  color: #e2e8f0;
  overflow-x: auto;
  min-height: 280px;
}

.terminal-prompt  { color: var(--aarkam-ice-cyan); font-weight: 600; }
.terminal-command { color: #ffffff; font-weight: 700; }
.terminal-output  { color: #94a3b8; margin-top: 0.5rem; margin-bottom: 1.25rem; }
.terminal-success { color: var(--aarkam-emerald); }
.terminal-warning { color: var(--aarkam-gold-amber); }
.terminal-info    { color: var(--aarkam-ice-cyan); }

/* ==========================================================================
   TRUST BADGE STRIP
   ========================================================================== */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--aarkam-emerald-light);
  font-family: 'JetBrains Mono', monospace;
}

.trust-badge-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--aarkam-emerald-50);
  border: 1px solid var(--aarkam-emerald-100);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--aarkam-emerald-900);
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   METRIC STAT — clean horizontal layout
   ========================================================================== */
.metric-stat {
  text-align: center;
  padding: 0 1.5rem;
}

.metric-stat + .metric-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-200);
  margin-top: 0.25rem;
}

.metric-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-400);
  margin-top: 0.125rem;
}

/* ==========================================================================
   MOBILE HAMBURGER MENU
   ========================================================================== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-200);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background-color: var(--surface-elevated);
  border-left: 1px solid var(--border-dark);
  z-index: 60;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  padding: 5rem 1.5rem 2rem;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav a {
  display: block;
  padding: 0.875rem 0;
  color: var(--text-200);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.2s ease;
}

.mobile-nav a:hover {
  color: var(--aarkam-emerald);
}

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-black);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* ==========================================================================
   MARKDOWN DOCUMENTATION TYPOGRAPHY
   ========================================================================== */
.markdown-body {
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.75;
}

.markdown-body h1 {
  color: #ffffff;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.25;
}

.markdown-body h2 {
  color: #f8fafc;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.markdown-body h3 {
  color: #e2e8f0;
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.markdown-body p {
  margin-bottom: 1.25rem;
}

.markdown-body a {
  color: var(--aarkam-emerald-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.markdown-body a:hover {
  color: var(--aarkam-emerald);
}

.markdown-body strong {
  color: #ffffff;
  font-weight: 700;
}

.markdown-body ul, .markdown-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body code:not(pre code) {
  background-color: #111a2e;
  color: var(--aarkam-emerald-light);
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.markdown-body pre {
  background-color: #060a14 !important;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.markdown-body pre code {
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   DOCUMENTATION TABLE STYLING
   ========================================================================== */
.doc-table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #070d1e;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 !important;
  font-size: 0.825rem;
  line-height: 1.5;
}

.markdown-body th {
  background-color: #0c1630;
  color: #f8fafc;
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 1rem;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 2px solid rgba(16, 185, 129, 0.35);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.markdown-body td {
  padding: 0.75rem 1rem;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background-color: transparent;
  color: #cbd5e1;
  vertical-align: middle;
}

.markdown-body tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02);
}

.markdown-body tr:hover td {
  background-color: rgba(16, 185, 129, 0.04);
}

.markdown-body hr {
  border: 0;
  height: 1px;
  background-color: #1e293b;
  margin: 2.5rem 0;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

/* Subtle noise texture overlay for hero */
.noise-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Blueprint grid for dark technical sections */
.grid-bg {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Emerald accent line (top border) */
.accent-top-emerald {
  border-top: 2px solid var(--aarkam-emerald);
}

/* Smooth color-coded left border variants */
.border-l-emerald  { border-left: 3px solid var(--aarkam-emerald); }
.border-l-cyan     { border-left: 3px solid var(--aarkam-ice-cyan); }
.border-l-amber    { border-left: 3px solid var(--aarkam-gold-amber); }
.border-l-indigo   { border-left: 3px solid var(--aarkam-royal-indigo); }
.border-l-purple   { border-left: 3px solid var(--aarkam-electric-purple); }
.border-l-teal     { border-left: 3px solid var(--aarkam-teal); }

/* Glow utilities (used sparingly) */
.glow-emerald {
  box-shadow: 0 0 30px -8px rgba(16, 185, 129, 0.2);
}