/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --code-bg: #f3f4f6;
  --high: #dc2626;
  --medium: #f59e0b;
  --low: #10b981;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --text: #f5f5f5;
    --text-secondary: #a1a1aa;
    --border: #2e2e2e;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --code-bg: #1e1e1e;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 6rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.install-box {
  display: inline-flex;
  align-items: center;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.install-box code {
  background: none;
  padding: 0;
  font-size: 1rem;
}

.copy-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
}

.copy-btn:hover {
  background: var(--accent-hover);
}

.install-alt {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Sections */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.section > p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* Problem Grid */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.problem-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.problem-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.problem-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Terminal */
.terminal {
  background: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.terminal-header {
  background: #2d2d2d;
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27ca40; }

.terminal-body {
  padding: 1.5rem;
  color: #e5e5e5;
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 0;
  background: #1e1e1e;
}

.terminal-body .high { color: #f87171; }
.terminal-body .medium { color: #fbbf24; }
.terminal-body .low { color: #34d399; }

/* Pattern Grid */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pattern-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.pattern-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.pattern-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Pricing */
.pricing-section {
  background: var(--bg-secondary);
  max-width: 100%;
  padding: 4rem 2rem;
}

.pricing-section h2,
.pricing-section > p {
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto 0;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
}

.price-period {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.pricing-card ul {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-card li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
}

.pricing-card li::before {
  content: "✓";
  color: var(--low);
  margin-right: 0.5rem;
}

.btn {
  display: block;
  text-align: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:hover {
  background: var(--border);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.pricing-note {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* CTA */
.cta-section {
  text-align: center;
  padding: 6rem 2rem;
}

.cta-section h2 {
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Docs Layout */
.docs-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 2rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.docs-nav a {
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

.docs-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.docs-content {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 800px;
}

.docs-content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.docs-content h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

.docs-content h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.docs-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.docs-content pre {
  margin-bottom: 1.5rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.docs-content th,
.docs-content td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.docs-content th {
  font-weight: 600;
}

.docs-content td {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .install-box {
    flex-direction: column;
    width: 100%;
    max-width: 400px;
  }

  .install-box code {
    font-size: 0.8rem;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-content {
    padding: 1.5rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-left {
    flex-direction: column;
    gap: 0.5rem;
  }
}
