/* ===== Variables ===== */
:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --text-bright: #f0f6fc;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #3fb950;
  --purple: #bc8cff;
  --radius: 8px;
  --max-w: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
}

.nav-links { display: flex; gap: 24px; }

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

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

/* ===== Hero ===== */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: -1px;
  max-width: 800px;
  margin: 0 auto 20px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #1a6dd3;
  color: #fff;
}

.btn-primary:hover {
  background: #1f7fe8;
  color: #fff;
}

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

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

.hero-code {
  max-width: 520px;
  margin: 0 auto;
}

.hero-code pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
  overflow-x: auto;
}

.hero-code code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.hero-code .c { color: var(--text-muted); }

/* ===== Problem ===== */
.problem {
  padding: 80px 0;
  background: var(--bg-alt);
}

.problem h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 40px;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.problem-card h3 {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.problem-card p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ===== Features ===== */
.features {
  padding: 80px 0;
}

.features h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s;
}

.feature:hover { border-color: var(--accent); }

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 17px;
  color: var(--text-bright);
  margin-bottom: 8px;
}

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

/* ===== Architecture ===== */
.architecture {
  padding: 80px 0;
  background: var(--bg-alt);
}

.architecture h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 40px;
}

.arch-diagram {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.arch-storage {
  gap: 24px;
}

.arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 28px;
  text-align: center;
  min-width: 160px;
}

.arch-box span {
  display: block;
  font-weight: 600;
  color: var(--text-bright);
  font-size: 15px;
}

.arch-box small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.arch-server { border-color: var(--accent); }
.arch-pg { border-color: var(--green); }
.arch-redis { border-color: var(--purple); }

.arch-arrow {
  width: 2px;
  height: 28px;
  background: var(--border);
  margin: 0 auto;
}

.arch-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 24px;
}

/* ===== How It Works ===== */
.how-it-works {
  padding: 80px 0;
}

.how-it-works h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 48px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.step {
  position: relative;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.step p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.step pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow-x: auto;
}

.step code {
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
}

/* ===== Use Cases ===== */
.use-cases {
  padding: 80px 0;
  background: var(--bg-alt);
}

.use-cases h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 40px;
}

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.use-case {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.use-case h3 {
  font-size: 17px;
  color: var(--text-bright);
  margin-bottom: 8px;
}

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

/* ===== Pricing ===== */
.pricing {
  padding: 80px 0;
}

.pricing h2 {
  text-align: center;
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.pricing-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 48px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  align-items: start;
}

.pricing-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
}

.pricing-card-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(88, 166, 255, 0.1);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.pricing-tier {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.pricing-price {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.1;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-period {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-card .btn {
  width: 100%;
  text-align: center;
}

/* ===== Waitlist ===== */
.waitlist {
  padding: 80px 0;
  background: var(--bg-alt);
  text-align: center;
}

.waitlist h2 {
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.waitlist-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 32px;
}

.waitlist-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto;
}

.waitlist-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.waitlist-form input[type="email"]:focus {
  border-color: var(--accent);
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--text-muted);
}

/* ===== Open Source ===== */
.open-source {
  padding: 80px 0;
  text-align: center;
}

.open-source h2 {
  font-size: 32px;
  color: var(--text-bright);
  margin-bottom: 16px;
}

.open-source p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto 28px;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero { padding: 60px 0 50px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .problem, .features, .architecture, .how-it-works, .use-cases, .pricing, .waitlist, .open-source { padding: 56px 0; }
  .waitlist-form { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .arch-storage { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 8px; }
  .nav-links { gap: 12px; flex-wrap: wrap; }
  .nav-links a { font-size: 12px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 16px; }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 200;
  font-size: 14px;
}

.skip-link:focus {
  top: 8px;
}
