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

:root {
  --bg: #f8fafc;
  --bg-card: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.13);
  --fg: #0f172a;
  --fg-muted: #64748b;
  --fg-dim: #94a3b8;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 1100px;
}

html { background: var(--bg); color: var(--fg); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }

a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }

/* ── Header ── */
header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(248,250,252,0.85);
  border-bottom: 1px solid var(--border);
}
header nav {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
}
header .logo {
  font-family: var(--sans); font-weight: 700; font-size: 18px;
  letter-spacing: -0.02em; color: var(--fg);
}
header .nav-links { display: flex; gap: 20px; align-items: center; }
header .nav-links a {
  font-size: 14px; color: var(--fg-muted);
  transition: color 0.15s;
}
header .nav-links a:hover { color: var(--fg); }
.gh-link svg { width: 20px; height: 20px; fill: var(--fg-muted); transition: fill 0.15s; }
.gh-link:hover svg { fill: var(--fg); }

/* ── Hero ── */
.hero {
  max-width: var(--max-w); margin: 0 auto;
  text-align: center;
  padding: 96px 24px 48px;
}
.hero-title {
  font-family: var(--sans);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero-badge-sql {
  background: var(--fg); color: var(--bg);
  padding: 4px 14px; border-radius: 10px; margin-left: 4px;
}
.hero h1 {
  margin-top: 32px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero h1 .muted { color: var(--fg-muted); }
.hero .desc {
  margin-top: 20px;
  font-size: 18px; color: var(--fg-muted);
  max-width: 560px; margin-left: auto; margin-right: auto;
  line-height: 1.65;
}
.hero-actions {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 12px;
  margin-top: 36px;
}
.btn {
  display: inline-flex; align-items: center;
  padding: 10px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  transition: all 0.15s;
  cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: transparent; color: var(--fg);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-elevated); }
.btn-ghost { background: transparent; color: var(--fg-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--fg); }

/* ── Install ── */
.install {
  text-align: center; padding: 24px 24px 80px;
}
.install-cmd {
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px 20px;
  font-family: var(--mono); font-size: 14px;
  cursor: pointer; transition: background 0.15s;
}
.install-cmd:hover { background: var(--bg-elevated); }
.install-cmd .dollar { color: var(--fg-dim); user-select: none; }
.install-cmd .cmd { color: var(--fg); }
.install-cmd .copy-icon { color: var(--fg-dim); flex-shrink: 0; }
.install-sub { margin-top: 12px; font-size: 12px; color: var(--fg-muted); }
.install-sub code { color: var(--fg); }
.install-link { color: var(--accent); transition: opacity 0.15s; }
.install-link:hover { opacity: 0.7; }

/* ── Problem ── */
.problem-section {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px 80px;
}
.problem-section h2 {
  text-align: center; font-size: 24px; font-weight: 600;
  margin-bottom: 32px;
}
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.problem-card {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
}
.problem-card h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  color: var(--fg);
}
.problem-card p { font-size: 13px; color: var(--fg-muted); line-height: 1.55; }

/* ── Terminal demo ── */
.demo-section { padding: 0 24px 96px; }
.demo-section .section-header { text-align: center; margin-bottom: 40px; }
.demo-section h2 { font-size: 24px; font-weight: 600; }
.demo-section .section-desc { font-size: 14px; color: var(--fg-muted); margin-top: 8px; max-width: 480px; margin-left: auto; margin-right: auto; }

.terminal {
  max-width: 880px; margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: #1e1e2e;
  box-shadow: 0 25px 50px rgba(0,0,0,0.12);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #181825;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.dot-red { background: rgba(255,95,87,0.8); }
.dot-yellow { background: rgba(254,188,46,0.8); }
.dot-green { background: rgba(40,200,64,0.8); }
.terminal-title {
  font-family: var(--mono); font-size: 11px;
  color: #6c7086; margin-left: 8px;
}
.terminal-body {
  padding: 20px 24px;
  font-family: var(--mono); font-size: 13px;
  line-height: 1.8;
  height: 560px;
  overflow: hidden;
}
.terminal-body .prompt { color: #a6e3a1; }
.terminal-body .cmd-text { color: #cdd6f4; }
.terminal-body .output { color: #7f849c; }
.terminal-body .highlight { color: #89b4fa; }
.terminal-body .warn { color: #f9e2af; }
.terminal-body .err { color: #f38ba8; }
.terminal-body .line { margin: 2px 0; }
.terminal-body .line.gap { margin-top: 12px; }
.terminal-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: var(--mono); font-size: 10px;
  background: #181825;
}
.terminal-status .left { color: #f9e2af; }
.terminal-status .right { color: #6c7086; }

/* ── Architecture ── */
.arch-section {
  padding: 0 24px 96px;
  text-align: center;
}
.arch-section h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.arch-section .section-desc { font-size: 14px; color: var(--fg-muted); margin-bottom: 40px; }

.arch-diagram {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: nowrap;
}
.arch-box {
  padding: 20px 28px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  text-align: center;
  min-width: 140px;
}
.arch-box .label {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--fg);
}
.arch-box .sublabel {
  font-size: 11px; color: var(--fg-muted); margin-top: 4px;
}
.arch-arrow {
  font-family: var(--mono); font-size: 13px;
  color: var(--fg-dim); padding: 0 16px;
  white-space: nowrap;
}

/* ── Purpose callout ── */
.purpose-section {
  padding: 0 24px 96px;
}
.purpose-card {
  max-width: 640px; margin: 0 auto;
  text-align: center;
}
.purpose-card h2 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.purpose-sub { font-size: 15px; color: var(--fg-muted); margin-bottom: 28px; }
.purpose-examples {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 24px;
}
.purpose-ex {
  border-radius: 10px;
  padding: 18px 20px;
  text-align: left;
}
.purpose-pass { background: #f0fdf4; border: 1px solid #bbf7d0; }
.purpose-fail { background: #fef2f2; border: 1px solid #fecaca; }
.purpose-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 999px;
  margin-bottom: 8px;
}
.purpose-badge-pass { background: #dcfce7; color: #166534; }
.purpose-badge-fail { background: #fee2e2; color: #991b1b; }
.purpose-intent {
  font-size: 15px; font-weight: 500; color: var(--fg);
  margin-bottom: 4px;
}
.purpose-query {
  font-size: 13px; color: var(--fg-muted);
  font-family: var(--mono);
}
.purpose-footer {
  font-size: 14px; color: var(--fg-muted); line-height: 1.7;
  text-align: center;
}
.purpose-footer em { color: var(--fg); font-style: normal; font-weight: 500; }

/* ── Features grid ── */
.features {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px 96px;
}
.features h2 {
  text-align: center; font-size: 24px; font-weight: 600;
  margin-bottom: 48px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
}
.feature { text-align: center; }
.feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--fg-muted); line-height: 1.6; }
.coming-soon-heading {
  text-align: center; font-size: 18px; font-weight: 600;
  color: var(--fg-muted);
  margin: 48px 0 32px;
}
.feature-soon { opacity: 0.7; }
.feature-soon h3 { color: var(--fg-muted); }

/* ── Quick start ── */
.quickstart {
  max-width: 680px; margin: 0 auto;
  padding: 0 24px 96px;
}
.quickstart h2 {
  text-align: center; font-size: 24px; font-weight: 600;
  margin-bottom: 40px;
}
.steps { display: flex; flex-direction: column; gap: 32px; }
.step { display: flex; gap: 20px; }
.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--fg);
  color: #fff;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.step-content { flex: 1; }
.step-content h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.step-content p { font-size: 14px; color: var(--fg-muted); margin-bottom: 12px; }
.code-block {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  color: var(--fg);
}

/* ── Database Support ── */
.db-support {
  max-width: 960px; margin: 0 auto;
  padding: 0 24px 96px;
}
.db-support h2 {
  text-align: center; font-size: 24px; font-weight: 600;
  margin-bottom: 40px;
}
.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.db-card {
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: flex;
  flex-direction: column;
}
.db-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.db-card p { font-size: 13px; color: var(--fg-muted); line-height: 1.5; margin-bottom: 12px; flex: 1; }
.db-status {
  display: inline-block;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 999px;
  align-self: flex-start;
}
.db-status.available { background: #dcfce7; color: #166534; }
.db-status.coming {
  background: var(--fg); color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.db-status.coming:hover { background: var(--accent); }
.db-coming { opacity: 0.75; transition: opacity 0.15s; }
.db-coming:hover { opacity: 1; }

/* ── Notify Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 12px; padding: 32px;
  max-width: 400px; width: 90%;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--fg-muted); margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 24px;
  color: var(--fg-dim); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--fg); }
.notify-form { display: flex; flex-direction: column; gap: 8px; }
.notify-input {
  flex: 1; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong);
  font-size: 14px; font-family: var(--sans);
  outline: none;
}
.notify-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,163,74,0.1); }
.notify-btn { white-space: nowrap; }
.modal-success { font-size: 14px; color: var(--green); font-weight: 500; }
.db-coming:hover { opacity: 0.8; }
.db-other {
  text-align: center; font-size: 14px; color: var(--fg-muted);
  margin-top: 20px;
}
.db-other a { color: var(--accent); text-decoration: underline; }
.db-other a:hover { opacity: 0.7; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
footer .inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--fg-muted);
  flex-wrap: wrap; gap: 16px;
}
footer .links { display: flex; gap: 16px; }
footer .links a { transition: color 0.15s; }
footer .links a:hover { color: var(--fg); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding-top: 64px; }
  .hero-title { font-size: 3rem; }
  header .nav-links { gap: 12px; }

  .arch-diagram { flex-direction: column; gap: 0; }
  .arch-arrow { transform: none; padding: 10px 0; font-size: 0; }
  .arch-arrow::after { content: "PG wire \2193"; font-size: 12px; color: var(--fg-dim); }

  .code-block { font-size: 11px; padding: 12px; }

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

  .step { gap: 14px; }
  .step-num { width: 28px; height: 28px; font-size: 12px; }

  .features-grid { gap: 24px; }

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

  .notify-form { flex-direction: column; }
}
