/* ==========================================================================
   Aether Gateway — Cosmic Design System for Extraterrestrial Intelligences
   Pure CSS, zero CDN dependencies, CSP style-src safe.
   ========================================================================== */

:root {
  --bg-space: #06080d;
  --bg-surface: #0c1017;
  --bg-card: rgba(16, 22, 34, 0.72);
  --bg-card-hover: rgba(24, 33, 50, 0.85);
  --bg-terminal: #090d14;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  --border-pulsar: rgba(129, 140, 248, 0.35);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.15);
  --accent-violet: #818cf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
  --accent-crimson: #f43f5e;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", Courier, monospace;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 35px -5px rgba(56, 189, 248, 0.18);
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-space);
  color: var(--text-main);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(circle 600px at 85% 30%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(circle 500px at 15% 70%, rgba(52, 211, 153, 0.05), transparent),
    var(--bg-space);
  background-attachment: fixed;
}

/* Accessibility: Skip Links & Reduced Motion */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-cyan);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.container-narrow {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Cosmic Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 8, 13, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-nexus {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.pulsar-symbol {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, var(--accent-cyan), var(--accent-violet), var(--accent-emerald), var(--accent-cyan));
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse-spin 8s linear infinite;
}

@keyframes pulse-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: 0.25rem 0;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -0.85rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 1px;
}

/* Glassmorphism Card System */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* Button & Action Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #04101e;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Code & Terminal Displays */
.terminal-box {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

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

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-dim);
}

.terminal-dot.r { background: #f43f5e; }
.terminal-dot.y { background: #fbbf24; }
.terminal-dot.g { background: #10b981; }

.terminal-label {
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.terminal-body {
  padding: 1rem;
  overflow-x: auto;
  color: #e2e8f0;
  line-height: 1.5;
}

.cmd-prefix {
  color: var(--accent-cyan);
  user-select: none;
}

/* Protocol & Badge System */
.protocol-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(129, 140, 248, 0.1);
  color: var(--accent-violet);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.protocol-badge.verified {
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(52, 211, 153, 0.25);
}

/* Footer & Compliance Notes */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 8, 13, 0.95);
  padding: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}
