/* ============================================
   UPLINK DOCS — Pure CSS
   ============================================ */

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

:root {
  --bg: #0a0a1a;
  --bg-card: rgba(15, 15, 35, 0.8);
  --bg-code: rgba(0, 240, 255, 0.05);
  --accent: #00f0ff;
  --accent-dim: rgba(0, 240, 255, 0.15);
  --accent-glow: rgba(0, 240, 255, 0.3);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --text: #e2e8f0;
  --text-muted: #7a8ba0;
  --border: rgba(0, 240, 255, 0.1);
  --font-mono: 'Space Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* ---- Starfield Canvas ---- */
#stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---- Top Bar ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}

.topnav { display: flex; gap: 28px; }
.topnav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.topnav a:hover { color: var(--accent); opacity: 1; }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
}
.mobile-menu a { color: var(--text-muted); font-size: 16px; }
.mobile-menu.open { display: flex; }

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 160px 24px 80px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  padding: 6px 16px;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 700;
  letter-spacing: 12px;
  color: #fff;
  text-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(0, 240, 255, 0.1);
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 0 36px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Terminal block */
.hero-terminal {
  max-width: 520px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  animation: terminalRainbow 6s linear infinite;
}

@keyframes terminalRainbow {
  0%   { border-color: #ff4466; box-shadow: 0 0 12px rgba(255,68,102,0.3), 0 0 40px rgba(255,68,102,0.08); }
  16%  { border-color: #ff9f43; box-shadow: 0 0 12px rgba(255,159,67,0.3), 0 0 40px rgba(255,159,67,0.08); }
  33%  { border-color: #ffd32a; box-shadow: 0 0 12px rgba(255,211,42,0.3), 0 0 40px rgba(255,211,42,0.08); }
  50%  { border-color: #4ade80; box-shadow: 0 0 12px rgba(74,222,128,0.3), 0 0 40px rgba(74,222,128,0.08); }
  66%  { border-color: #00b4d8; box-shadow: 0 0 12px rgba(0,180,216,0.3), 0 0 40px rgba(0,180,216,0.08); }
  83%  { border-color: #c084fc; box-shadow: 0 0 12px rgba(192,132,252,0.3), 0 0 40px rgba(192,132,252,0.08); }
  100% { border-color: #ff4466; box-shadow: 0 0 12px rgba(255,68,102,0.3), 0 0 40px rgba(255,68,102,0.08); }
}

.terminal-bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0.6;
}

.hero-terminal code {
  display: block;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

.terminal-muted { color: var(--text-muted); }
.terminal-accent { color: var(--accent); }

/* ---- Install Steps ---- */
.install {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}

.install-prereq {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.25s;
}

.install-step:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.06);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.step-content h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.code-inline {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  overflow-x: auto;
  user-select: all;
  cursor: text;
}

.code-inline code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-size: inherit;
  color: inherit;
}

.step-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ---- Features ---- */
.features {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: all 0.25s;
}

.feature-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.06);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 10px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 2px;
}

.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--accent); opacity: 1; }

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}
.footer-copy a { color: var(--accent); }

/* ---- Docs Layout (non-home pages) ---- */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 56px;
}

.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 260px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  background: rgba(10, 10, 26, 0.95);
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar a:hover { color: var(--text); background: var(--accent-dim); opacity: 1; }
.sidebar a.active { color: var(--accent); background: var(--accent-dim); }

.docs-content {
  margin-left: 260px;
  flex: 1;
  padding: 48px 56px 80px;
  max-width: 900px;
  min-width: 0;
}

.docs-content h1 {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 8px;
}

.docs-content .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.7;
}

.docs-content h2 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.docs-content h2:first-of-type {
  margin-top: 0;
}

.docs-content h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 32px;
  margin-bottom: 12px;
}

.docs-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--text-muted);
}

.docs-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.docs-content li strong {
  color: var(--text);
}

/* ---- Tables ---- */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.docs-content thead {
  background: rgba(0, 240, 255, 0.06);
}

.docs-content th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.docs-content td {
  padding: 10px 16px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 240, 255, 0.05);
  line-height: 1.5;
}

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

.docs-content tr:hover td {
  background: rgba(0, 240, 255, 0.03);
}

.docs-content td code {
  font-family: var(--font-mono);
  font-size: 12px;
}

.docs-content td strong {
  color: var(--text);
  font-weight: 600;
}

/* Table wrapper for horizontal scroll on small screens */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  margin-bottom: 0;
  min-width: 500px;
}

/* ---- Code blocks ---- */
.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  max-width: 100%;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: #4ade80; border-color: #4ade80; }

.code-block pre {
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
  word-wrap: normal;
}

/* Inline code */
.docs-content code:not(pre code) {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  word-break: break-word;
}

/* Callout boxes */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

.callout.warning {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.callout.tip {
  border-left-color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Docs footer */
.docs-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.docs-footer a {
  color: var(--accent);
}

/* ---- Theme preview cards ---- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.theme-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}

.theme-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.theme-preview {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-preview .swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
}

.theme-info {
  padding: 12px 16px;
  background: rgba(0,0,0,0.4);
}

.theme-info h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.theme-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .topnav { display: none; }
  .hamburger { display: flex; }

  .feature-grid { grid-template-columns: 1fr; }

  .hero { padding: 120px 20px 60px; }
  .hero-title { letter-spacing: 6px; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }

  /* Docs pages */
  .sidebar {
    display: none;
    width: 100%;
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    right: 0;
    border-right: none;
    z-index: 90;
  }
  .sidebar.open { display: block; }
  .docs-content { margin-left: 0; padding: 32px 20px 60px; }

  .docs-content h1 { font-size: 24px; }
  .docs-content h2 { font-size: 17px; }

  .theme-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-terminal { font-size: 12px; }
  .btn { padding: 10px 20px; font-size: 14px; }
  .docs-content { padding: 24px 16px 48px; }
}
