/* ═══════════════════════════════════════════════════════════════
   CSharpEssentials — Documentation Site
   Modern dark-first design with accent highlights
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-card: #21262d;
  --bg-code: #1a1f26;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-glow: rgba(88, 166, 255, 0.15);
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --brand-secondary: #bc8cff;
  --success: #3fb950;
  --border: #30363d;
  --border-accent: #388bfd;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --max-width: 1200px;
  --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
}

/* ── Nav ──────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo .accent { color: var(--accent); }

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-cta {
  background: var(--accent) !important;
  color: var(--bg-primary) !important;
  font-weight: 600 !important;
}

.nav-cta:hover { opacity: 0.9; }

/* ── Hero ─────────────────────────────────────────────────────── */

.hero {
  padding: calc(var(--nav-height) + 80px) 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: none;
}

.hero-bg {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Install Box ─────────────────────────────────────────────── */

.install-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 8px;
}

.install-box:hover { border-color: var(--accent); }
.install-box > span:first-child { color: var(--accent-green); }
.install-box code { color: var(--text-primary); }
.install-box .copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  transition: color 0.2s;
}
.install-box .copy-btn:hover { color: var(--accent); }

/* ── Stats ───────────────────────────────────────────────────── */

.stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.stat-card { text-align: center; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Sections ────────────────────────────────────────────────── */

section {
  padding: 80px 24px;
}

section > .container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 48px;
}

/* ── Feature Grid ────────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-card code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ── Steps ───────────────────────────────────────────────────── */

.steps {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 40px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  min-width: 44px; max-width: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.step code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.step > div { flex: 1; min-width: 0; }

/* ── Tabs ────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Code Blocks ─────────────────────────────────────────────── */

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.code-header .copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.code-header .copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
}

/* Syntax colors */
.kw { color: var(--accent-purple); }
.str { color: #a5d6ff; }
.cmt { color: var(--text-muted); font-style: italic; }
.method { color: #d2a8ff; }
.type { color: #7ee787; }
.num { color: #79c0ff; }
.prop { color: #ffa657; }

/* ── Sink Grid & Cards ───────────────────────────────────────── */

.sink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 24px;
}

.sink-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.sink-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }

.sink-card.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.sink-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.sink-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.sink-snippet { display: none; }
.sink-snippet.active { display: block; }

/* ── Playground ──────────────────────────────────────────────── */

.playground-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}

.playground-editor,
.playground-output {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.playground-editor textarea {
  width: 100%;
  min-height: 260px;
  padding: 16px 20px;
  background: transparent;
  color: var(--text-primary);
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.playground-output pre {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-secondary);
  min-height: 260px;
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
}

/* ── Benchmark Table ─────────────────────────────────────────── */

.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.bench-table thead th {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bench-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.bench-table tbody tr:last-child td { border-bottom: none; }

.bench-table tbody tr:hover td { background: rgba(88, 166, 255, 0.04); }

/* ── NuGet package table ─────────────────────────────────────── */

.pkg-table code.pkg-id {
  font-size: 0.78rem;
  word-break: break-all;
}

.pkg-table a {
  color: var(--brand-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.pkg-table a:hover { text-decoration: underline; }

.pkg-notes {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pkg-notes p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pkg-notes p:last-child { margin-bottom: 0; }

.bench-fast { color: var(--accent-green); font-weight: 600; }

.bench-bar {
  display: inline-block;
  height: 6px;
  background: var(--accent-green);
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Footer ──────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: none;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a,
.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer a:hover { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hamburger { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
  }

  .nav-links.open { display: flex; }

  .hero h1 { font-size: 2rem; }
  .stats { gap: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
  .sink-grid { grid-template-columns: repeat(2, 1fr); }
  .playground-container { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 16px; }
}

@media (max-width: 480px) {
  .sink-grid { grid-template-columns: 1fr; }
  section { padding: 48px 16px; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
