/* Nidus Landing Page — Dark theme matching the app */

:root {
  --bg: #0f172a;
  --bg-primary: #111827;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-primary: #f3f4f6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.9em;
}

/* ── Nav ── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}

.nav-github:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.nav-github svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* ── Hero ── */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.hero-demo {
  max-width: 780px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-secondary);
}

.hero-demo img {
  width: 100%;
}

.hero-tech {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── Stats strip ── */

.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ── Sections (shared) ── */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ── Features ── */

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

.feature-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s;
}

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

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.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;
}

/* ── Screenshots ── */

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

.screenshot-item {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: border-color 0.2s;
}

.screenshot-item:hover {
  border-color: var(--primary);
}

.screenshot-item img {
  width: 100%;
  height: auto;
}

.screenshot-item.placeholder-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border-style: dashed;
}

.screenshot-item.placeholder-fallback .screenshot-label {
  display: block;
}

.screenshot-label {
  display: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.screenshot-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* ── Tech stack ── */

.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: start;
}

.tech-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.tech-table th,
.tech-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9rem;
}

.tech-table thead {
  background: var(--bg-secondary);
}

.tech-table th {
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.tech-table td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

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

.tech-arch {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.tech-arch h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.tech-arch pre {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tech-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Installation ── */

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

.install-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.install-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-card .install-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.install-card pre {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}

.install-card pre code {
  color: var(--text-secondary);
}

.install-card pre .cmd {
  color: var(--primary);
}

.install-card pre .comment {
  color: var(--text-muted);
}

.install-card pre .string {
  color: var(--success);
}

.install-card .code-wrapper,
.install-card .download-area {
  flex: 1;
}

.install-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.install-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.install-hint {
  margin-top: 10px;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.install-hint code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--bg-secondary);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82em;
  color: var(--accent-hover);
}

/* ── Copy button ── */

.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

/* ── Download area ── */

.download-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.download-btn {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.download-btn svg {
  flex-shrink: 0;
}

/* ── Custom dropdown ── */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.dropdown-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.dropdown-toggle svg {
  transition: transform 0.2s;
}

.dropdown.open .dropdown-toggle svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 200px;
  padding: 4px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.dropdown-item.detected {
  color: var(--primary);
  font-weight: 600;
}

/* ── Download button (in install-actions) ── */

.install-actions .download-btn {
  flex: 1;
}

.install-actions .dropdown {
  flex-shrink: 0;
}

/* ── Comparison ── */

.compare-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9rem;
}

.compare-table thead {
  background: var(--bg-secondary);
}

.compare-table th {
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

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

.compare-table tr.highlight td {
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
  font-weight: 500;
}

.check {
  color: var(--success);
}

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

/* ── Footer ── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

.footer-copy {
  width: 100%;
  text-align: center;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Animations ── */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 48px 24px 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .stats-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

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

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

  .section {
    padding: 48px 16px;
  }

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

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
