/* ==============================================================================
   Aetheris Connect — Distributed Application Connectivity Platform
   Style System: Linear / Vercel / Stripe Engineering Aesthetics
   ============================================================================== */

:root {
  --bg-main: #090a0f;
  --bg-surface: #0e121b;
  --bg-surface-elevated: #151b28;
  --bg-code: #0b0e14;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.35);
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-code: #e2e8f0;
  
  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px -5px rgba(56, 189, 248, 0.15);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background Ambient Glow */
.bg-ambient-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(56, 189, 248, 0.12), transparent 45%),
    radial-gradient(circle at 90% 40%, rgba(129, 140, 248, 0.08), transparent 35%);
}

.bg-ambient-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 40px 40px;
  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);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 26px;
  height: 26px;
  color: var(--accent-cyan);
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

nav a {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

nav a.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  padding: 5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  position: relative;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent-emerald);
  opacity: 0.4;
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 20%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.25rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-main);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-surface-elevated);
}

/* SVG Topology Illustration */
.topology-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  margin: 2.5rem 0 4rem;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.topology-card svg {
  width: 100%;
  height: auto;
  max-height: 320px;
  display: block;
}

/* Feature & Architecture Grid */
.grid-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Code & Spec Panels */
.code-panel {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.code-content {
  padding: 1.2rem 1.25rem;
  overflow-x: auto;
  line-height: 1.7;
  color: var(--text-code);
}

.code-token-verb { color: #f43f5e; font-weight: 600; }
.code-token-path { color: #38bdf8; }
.code-token-header { color: #a78bfa; }
.code-token-string { color: #34d399; }
.code-token-comment { color: #64748b; font-style: italic; }

.copy-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* Documentation Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  padding: 3rem 0 5rem;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
}

.docs-sidebar h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.docs-nav-list {
  list-style: none;
  margin-bottom: 2rem;
}

.docs-nav-list a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.docs-nav-list a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.docs-nav-list a.active {
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.06);
}

.docs-content h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.docs-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

th {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-tertiary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

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

td code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Status Cards & Regional Metrics */
.status-overview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.status-badge-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.status-bar-row {
  margin-bottom: 1.5rem;
}

.status-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.status-uptime-track {
  display: flex;
  gap: 3px;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.uptime-segment {
  flex: 1;
  background: var(--accent-emerald);
  border-radius: 2px;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.uptime-segment:hover {
  opacity: 1;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.footer-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Responsive Media Queries */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .docs-sidebar {
    position: static;
  }
  .mobile-toggle {
    display: block;
  }
  nav ul {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1rem;
  }
  nav ul.show {
    display: flex;
  }
  .footer-wrapper {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
