/* ─── Anjungan Design System ───
 *  Dark theme · Emerald accent
 *  Inspired by Linear + Supabase
 * ────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Surface ladder ── */
  --canvas: #010102;
  --surface-1: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --surface-4: #1e1f21;

  /* ── Text ── */
  --ink: #f7f8f8;
  --ink-muted: #c8ccd4;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;

  /* ── Emerald accent ── */
  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-muted: rgba(16, 185, 129, 0.1);
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-border: rgba(16, 185, 129, 0.3);

  /* ── Borders ── */
  --hairline: #23252a;
  --hairline-strong: #34343a;

  /* ── Semantic ── */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Spacing ── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* ── Radii ── */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { color: var(--ink-muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.text-emerald { color: var(--primary); }
.text-muted { color: var(--ink-subtle); }
.text-tertiary { color: var(--ink-tertiary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: var(--font-mono); }

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 860px;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(1, 1, 2, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo:hover { color: var(--ink); }
.nav-logo .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--ink-subtle);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-cta {
  background: var(--primary);
  color: #000 !important;
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}
.nav-cta:hover {
  background: var(--primary-hover) !important;
  box-shadow: var(--shadow-glow);
}

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

/* ─── Hero ─── */
.hero {
  padding: 160px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-lg);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .highlight {
  color: var(--primary);
  position: relative;
}

.hero p {
  font-size: 1.2rem;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  color: var(--ink-subtle);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  color: #000;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--ink-tertiary);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-subtle);
  padding: 12px 16px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ─── Section ─── */
.section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-subtle);
}

.section-label {
  display: inline-block;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

/* ─── Feature Grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.feature-card:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-card:hover::before { opacity: 1; }

.feature-card .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
}
.feature-card .icon-wrap svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  stroke-width: 1.5;
  fill: none;
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Tech Stack ─── */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
}
.tech-badge:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-muted);
}
.tech-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* ─── Architecture ─── */
.arch-container {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.arch-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.arch-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.arch-header .dot-red { background: #ef4444; }
.arch-header .dot-yellow { background: #f59e0b; }
.arch-header .dot-green { background: #10b981; }
.arch-header span {
  color: var(--ink-tertiary);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  margin-left: var(--space-sm);
}

.arch-diagram {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.arch-diagram svg {
  width: 100%;
  max-width: 800px;
  height: auto;
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  text-align: center;
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-card .stat-label {
  color: var(--ink-subtle);
  font-size: 0.9rem;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-3xl) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-brand h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.footer-brand h3 .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}
.footer-brand p {
  font-size: 0.9rem;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-md);
}

.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: var(--space-sm);
}
.footer-col a {
  color: var(--ink-subtle);
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-tertiary);
}

/* ─── Docs Layout ─── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-2xl);
  padding-top: 96px;
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: var(--space-lg) 0;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 4px; }

.docs-sidebar h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-md);
}

.docs-nav {
  list-style: none;
  margin-bottom: var(--space-xl);
}

.docs-nav a {
  display: block;
  padding: 6px var(--space-md);
  font-size: 0.9rem;
  color: var(--ink-subtle);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}
.docs-nav a:hover { color: var(--ink); }
.docs-nav a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-muted);
}

.docs-content {
  padding: var(--space-2xl) 0 var(--space-4xl);
  max-width: 860px;
}

.docs-content h1 {
  font-size: 2.2rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--hairline);
}

.docs-content h2 {
  font-size: 1.6rem;
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
}

.docs-content h3 {
  font-size: 1.2rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
}

.docs-content p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.docs-content ul, .docs-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
  color: var(--ink-muted);
}

.docs-content li {
  margin-bottom: var(--space-sm);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
}

.docs-content th, .docs-content td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--hairline);
  font-size: 0.9rem;
}

.docs-content th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.docs-content td { color: var(--ink-muted); }

.docs-content blockquote {
  border-left: 3px solid var(--primary);
  padding: var(--space-md) var(--space-lg);
  background: var(--primary-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-lg);
}
.docs-content blockquote p { margin: 0; color: var(--ink-muted); }

.docs-content hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: var(--space-2xl) 0;
}

.docs-content code {
  font-size: 0.85em;
}

.docs-content pre code {
  font-size: inherit;
}

.docs-content .badge {
  display: inline-block;
  background: var(--primary-muted);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-sans);
}

/* ─── Docs Hub ─── */
.doc-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  text-decoration: none;
}

.doc-card:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.doc-card .doc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-muted);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-card .doc-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  stroke-width: 1.5;
  fill: none;
}

.doc-card-body { flex: 1; }

.doc-card-body h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--ink);
}

.doc-card-body p {
  font-size: 0.85rem;
  margin: 0;
  color: var(--ink-subtle);
}

/* ─── Page Header ─── */
.page-header {
  padding: 120px 0 40px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-2xl);
}

.page-header h1 { margin-bottom: var(--space-sm); }
.page-header p { color: var(--ink-subtle); font-size: 1.1rem; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface-1);
    border-bottom: 1px solid var(--hairline);
    padding: var(--space-lg);
    gap: var(--space-md);
  }
  .nav-links.open { display: flex; }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

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

  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar { display: none; }

  .hero {
    padding: 120px 0 40px;
  }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* ─── Doc Screenshots ─── */
.docs-screenshot {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  margin: var(--space-lg) 0;
}
.docs-screenshot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-primary);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-1);
}
.docs-screenshot-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.docs-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}
.docs-screenshot-footer {
  padding: 8px 16px;
  font-size: .8rem;
  color: var(--ink-tertiary);
  border-top: 1px solid var(--hairline);
}

/* ─── Utility ─── */
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.flex { display: flex; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
