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

:root {
  /* Background layers - zinc minimal dark mode */
  --bg:        #09090b;
  --bg-2:      #0e0e11;
  --bg-3:      #18181b;
  --bg-4:      #27272a;

  /* Borders */
  --border:    rgba(255,255,255,0.06);
  --border-h:  rgba(255,255,255,0.12);
  --border-a:  rgba(255,255,255,0.18);

  /* Accents — Minimal developer monochrome & indigo touch */
  --accent:         #ffffff;
  --accent-hover:   #f4f4f5;
  --accent-purple:  #818cf8;
  --accent-dim:     rgba(255,255,255,0.04);
  --accent-glow:    rgba(255,255,255,0.02);

  /* Status */
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;

  /* Text */
  --text:      #fafafa;
  --text-2:    #a1a1aa;
  --text-3:    #52525b;
  --code:      #e4e4e7;

  /* Typography */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:      'JetBrains Mono', 'Courier New', monospace;

  /* Shape */
  --radius:    6px;
  --radius-lg: 8px;
  --radius-sm: 4px;

  --shadow:    0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.7);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }

/* ── Typography & Headings ────────────────────────────────────────────────── */
h1, h2, h3, .nav-brand, .auth-title, .page-title, .modal-title, .hero-title, .features-title, .step-title, .land-cta-title {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── Page transitions ────────────────────────────────────────────────────── */
.page { animation: pageIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1.5rem;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem; color: var(--text); text-decoration: none;
  cursor: pointer;
}
.nav-logo {
  width: 24px; height: 24px; border-radius: 5px;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-pill {
  font-size: 0.72rem; color: var(--text-2);
  padding: 3px 10px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 12px;
  font-family: var(--mono);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.main { padding: 3rem 1.5rem; max-width: 960px; margin: 0 auto; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap;
  transition: all 0.15s ease; letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover); border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--accent-dim); border-color: var(--border-h);
}

.btn-outline {
  background: transparent; color: var(--text-2);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
  color: var(--text); background: var(--accent-dim); border-color: var(--border-h);
}

.btn-danger {
  background: rgba(239,68,68,0.08); color: var(--danger); border-color: rgba(239,68,68,0.15);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3);
}

.btn-full { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.72rem; border-radius: var(--radius-sm); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.7rem; font-weight: 500;
  color: var(--text-2); margin-bottom: 0.35rem;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.form-input {
  width: 100%; padding: 0.55rem 0.75rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.85rem; outline: none;
  transition: all 0.15s ease;
}
.form-input:focus { border-color: var(--border-a); background: var(--bg-3); }
.form-input::placeholder { color: var(--text-3); }
.form-hint { font-size: 0.72rem; color: var(--text-3); margin-top: 0.35rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.65rem; }
select.form-input { cursor: pointer; }

/* ── Auth Page ───────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth-box {
  width: 100%; max-width: 360px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.auth-header { margin-bottom: 1.75rem; }
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 1rem; font-weight: 600; }
.auth-brand .nav-logo { width: 22px; height: 22px; font-size: 10px; }
.auth-title { font-size: 1.25rem; font-weight: 600; }
.auth-sub { color: var(--text-2); font-size: 0.8rem; margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.8rem; color: var(--text-2); }
.auth-footer a { color: var(--text); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border-h); }
.auth-footer a:hover { border-bottom-color: var(--text); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: all 0.15s ease;
}
.card:hover { border-color: var(--border-h); }

/* ── DB Grid ─────────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.page-title { font-size: 1.35rem; font-weight: 600; }
.page-sub { font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }

.db-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
  cursor: pointer; transition: all 0.15s ease; position: relative;
}
.db-card:hover { border-color: var(--border-a); background: var(--bg-3); }
.db-card-dot {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem; font-size: 13px;
}
.db-card-name { font-size: 0.88rem; font-weight: 500; margin-bottom: 2px; color: var(--text); }
.db-card-slug { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); margin-bottom: 0.75rem; }
.db-card-stats { display: flex; gap: 0.85rem; }
.db-stat { font-size: 0.72rem; color: var(--text-2); }
.db-stat strong { color: var(--text); font-weight: 500; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 4rem 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--bg-2);
}
.empty-icon { font-size: 2rem; opacity: 0.4; }
.empty-title { font-size: 0.95rem; font-weight: 500; }
.empty-desc { font-size: 0.8rem; color: var(--text-2); max-width: 320px; line-height: 1.6; }

/* ── Detail Page ─────────────────────────────────────────────────────────── */
.back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-2); text-decoration: none; font-size: 0.8rem;
  margin-bottom: 1.25rem; transition: color 0.15s; cursor: pointer;
}
.back:hover { color: var(--text); }

.detail-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.detail-name-row { display: flex; align-items: center; gap: 10px; }
.detail-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.detail-name { font-size: 1.25rem; font-weight: 600; }
.detail-slug { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }

/* ── Info Tiles ──────────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; margin-bottom: 1.75rem; }
.tile {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 0.9rem;
}
.tile-label { font-size: 0.65rem; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.tile-val { font-size: 1rem; font-weight: 600; font-family: var(--mono); color: var(--text); }

/* ── Code Blocks ─────────────────────────────────────────────────────────── */
.code-wrap { position: relative; }
.code-block {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem 0.9rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--code);
  overflow-x: auto; white-space: nowrap;
  padding-right: 4.5rem;
}
.copy-btn {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 3px; padding: 2px 6px;
  font-size: 0.68rem; cursor: pointer; font-family: var(--font);
  transition: all 0.15s;
}
.copy-btn:hover { border-color: var(--border-h); color: var(--text); }
.copy-btn.ok { color: var(--success); border-color: rgba(16,185,129,0.3); }

/* ── Section ─────────────────────────────────────────────────────────────── */
.section { margin-bottom: 1.75rem; }
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section-title { font-size: 0.8rem; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Keys Table ──────────────────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.tbl th {
  background: var(--bg-2); padding: 0.5rem 0.75rem;
  font-size: 0.65rem; font-weight: 500; color: var(--text-2);
  text-align: left; letter-spacing: 0.05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.tbl td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--accent-dim); }
.mono-cell { font-family: var(--mono); font-size: 0.72rem; color: var(--code); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 10px; font-size: 0.68rem; font-weight: 500;
}
.badge-on { background: rgba(16,185,129,0.06); color: var(--success); border: 1px solid rgba(16,185,129,0.15); }
.badge-off { background: rgba(239,68,68,0.06); color: var(--danger); border: 1px solid rgba(239,68,68,0.12); }

/* ── SQL Console ─────────────────────────────────────────────────────────── */
.sql-editor {
  width: 100%; min-height: 100px; resize: vertical;
  background: var(--bg-2); color: var(--code);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.75rem; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6;
  outline: none; transition: all 0.15s ease;
}
.sql-editor:focus { border-color: var(--border-h); background: var(--bg-3); }
.console-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.5rem; flex-wrap: wrap; gap: 0.5rem;
}

/* Premium IDE Container & Layout */
.console-ide-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  position: relative;
}

/* Mac-style Window Header */
.console-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.mac-dots {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.mac-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.8;
}

.dot-red {
  background: #ef4444;
}

.dot-yellow {
  background: #fbbf24;
}

.dot-green {
  background: #10b981;
}

.console-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-2);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (max-width: 600px) {
  .console-title {
    display: none;
  }
}

/* Floating Inline API Key */
.console-key-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-family: var(--mono);
}

.console-key-label {
  color: var(--text-3);
  font-weight: 600;
}

.console-key-input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.4rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--text);
  width: 140px;
  outline: none;
  transition: all 0.12s ease;
}

.console-key-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 6px rgba(129, 140, 248, 0.15);
}

/* Editor Toolbar */
.console-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background: rgba(14, 14, 17, 0.6);
  border-bottom: 1px solid var(--border);
}

.console-editor-tools-left {
  display: flex;
  gap: 0.5rem;
}

.console-tool-btn {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}

.console-tool-btn:hover {
  color: var(--text);
  background: var(--border);
}

.console-tool-btn:active {
  background: var(--border-h);
}

.console-editor-lang {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Embedded Textarea Adapters */
.console-ide-wrap .sql-editor {
  border: none;
  border-radius: 0;
  min-height: 140px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.console-ide-wrap .sql-editor:focus {
  background: var(--bg);
  border-bottom-color: var(--border-h);
}

/* Quick Query Actions Bar */
.sql-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.quick-label {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.quick-pills-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  flex-grow: 1;
  padding: 2px 0;
}

.quick-pills-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.sql-pill-btn {
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.6rem;
  font-size: 0.68rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.sql-pill-btn:hover {
  color: var(--text);
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(129, 140, 248, 0.06);
  transform: translateY(-0.5px);
}

.sql-pill-btn:active {
  transform: translateY(0);
}

/* Embedded bottom status bar */
.console-ide-wrap .console-toolbar {
  margin-top: 0;
  padding: 0.65rem 1rem;
  background: var(--bg-3);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.console-hint { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); }
.results-box { margin-top: 0.85rem; }
.results-meta { font-size: 0.7rem; color: var(--text-3); font-family: var(--mono); margin-bottom: 0.4rem; display: flex; gap: 0.85rem; }
.results-err {
  background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-sm); padding: 0.75rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--danger);
}
.results-tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.results-tbl { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.results-tbl th {
  background: var(--bg-2); padding: 0.45rem 0.65rem;
  font-size: 0.65rem; font-weight: 500; color: var(--text-2);
  text-align: left; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.results-tbl td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border); font-family: var(--mono); color: var(--text-2); white-space: nowrap; }
.results-tbl td.null { color: var(--text-3); font-style: italic; }
.results-tbl tr:last-child td { border-bottom: none; }
.results-tbl tr:hover td { background: var(--accent-dim); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  animation: pageIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border-h);
  border-radius: var(--radius-lg); padding: 1.5rem;
  width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.key-reveal {
  background: var(--bg-3); border: 1px solid var(--border-h);
  border-radius: var(--radius-sm); padding: 0.75rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  word-break: break-all; margin: 0.75rem 0; line-height: 1.6;
}
.key-warn { font-size: 0.72rem; color: var(--warning); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 999;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 0.55rem 0.85rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 500;
  background: var(--bg-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: slideIn 0.2s ease;
  min-width: 200px; max-width: 320px; color: var(--text);
}
.toast-ok { border-color: rgba(16,185,129,0.2); }
.toast-err { border-color: rgba(239,68,68,0.2); }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; } }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent); border-radius: 50%;
  animation: rot 0.6s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; min-height: 150px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════════════════════════════════════════ */

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 7rem 1.5rem 5rem;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 500; color: var(--text-2);
  font-family: var(--mono); margin-bottom: 1.5rem;
}
.hero-badge::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); animation: pulse 2.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); } 50% { opacity: 0.5; box-shadow: 0 0 0 3px rgba(16,185,129,0); } }

.hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 1.25rem; color: var(--text);
}
.hero-title span {
  color: var(--text);
  text-decoration: underline; text-decoration-color: var(--border-a); text-underline-offset: 4px;
}
.hero-sub {
  font-size: 0.92rem;
  color: var(--text-2); max-width: 480px; margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-cta { display: flex; align-items: center; justify-content: center; gap: 0.65rem; flex-wrap: wrap; }
.hero-cta .btn-primary { padding: 0.65rem 1.5rem; font-size: 0.88rem; }
.hero-cta .btn-ghost { padding: 0.65rem 1.5rem; font-size: 0.88rem; }

/* ── Sandbox Section ─────────────────────────────────────────────────────── */
.sandbox-section {
  padding: 4.5rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.sandbox-header {
  text-align: center;
  margin-bottom: 2rem;
}
.sandbox-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}
.sandbox-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}
.sandbox-panel:hover {
  border-color: var(--border-h);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}
.panel-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.panel-body.code-body {
  background: #070708;
  padding: 1rem;
  position: relative;
  overflow: auto;
  min-height: 200px;
}
.sandbox-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}
.sample-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.query-pill {
  font-size: 0.68rem;
  font-family: var(--mono);
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}
.query-pill:hover {
  border-color: var(--border-h);
  color: var(--text);
  background: var(--accent-dim);
}
.sandbox-editor {
  width: 100%;
  min-height: 90px;
  flex: 1;
  resize: none;
  background: #070708;
  color: var(--code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  outline: none;
  transition: all 0.15s ease;
  margin-bottom: 0.5rem;
}
.sandbox-editor:focus {
  border-color: var(--border-h);
}
.panel-tabs {
  display: flex;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-btn {
  padding: 0.65rem 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}
.demo-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
  color: var(--code);
}
.demo-code .cm { color: var(--text-3); }
.demo-code .ck { color: #d4d4d8; font-weight: 500; }
.demo-code .cv { color: var(--text-2); }
.demo-code .cs { color: var(--text); }
.demo-code .cn { color: var(--text); }

.sandbox-response-wrapper {
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.results-msg {
  padding: 0.5rem;
  background: rgba(16,185,129,0.04);
  border: 1px solid rgba(16,185,129,0.12);
  border-radius: var(--radius-sm);
  margin-top: 0.4rem;
}

@media (max-width: 768px) {
  .sandbox-container {
    grid-template-columns: 1fr;
  }
}

/* ── Features ────────────────────────────────────────────────────────────── */
.features {
  padding: 4.5rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.features-header { text-align: center; margin-bottom: 2.5rem; }
.section-eyebrow {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  color: var(--text-2); letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.features-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.features-sub { color: var(--text-2); font-size: 0.85rem; margin-top: 4px; }

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem; max-width: 960px; margin: 0 auto;
}
.feat {
  padding: 1.25rem; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.15s ease;
}
.feat:hover { border-color: var(--border-h); background: var(--bg-3); }
.feat-icon {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-bottom: 0.85rem;
}
.feat-name { font-weight: 500; margin-bottom: 0.25rem; font-size: 0.88rem; color: var(--text); }
.feat-desc { font-size: 0.8rem; color: var(--text-2); line-height: 1.6; }

/* ── How it works ────────────────────────────────────────────────────────── */
.how {
  padding: 4.5rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.how-inner { max-width: 680px; margin: 0 auto; }
.steps { display: flex; flex-direction: column; gap: 0; margin-top: 2rem; }
.step {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 1rem; padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; color: var(--text-2);
  flex-shrink: 0; margin-top: 2px;
}
.step-title { font-weight: 500; margin-bottom: 0.25rem; font-size: 0.88rem; color: var(--text); }
.step-desc { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; }
.step-code {
  margin-top: 0.5rem; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.55rem 0.75rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--text-2);
  overflow-x: auto; white-space: nowrap;
}

/* ── API Reference strip ─────────────────────────────────────────────────── */
.api-strip {
  padding: 4.5rem 1.5rem;
  background: var(--bg); border-top: 1px solid var(--border);
}
.api-strip-inner { max-width: 960px; margin: 0 auto; }
.api-endpoints { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1.5rem; }
.endpoint-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.78rem;
  transition: all 0.12s ease;
}
.endpoint-row:hover { border-color: var(--border-h); }
.method {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0; width: 42px; text-align: center;
}
.method-get { background: rgba(16,185,129,0.08); color: var(--success); }
.method-post { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.method-delete { background: rgba(239,68,68,0.08); color: var(--danger); }
.endpoint-path { color: var(--code); flex: 1; font-size: 0.75rem; }
.endpoint-desc { font-size: 0.75rem; color: var(--text-2); font-family: var(--font); }

/* ── Landing CTA ─────────────────────────────────────────────────────────── */
.land-cta {
  padding: 5rem 1.5rem; text-align: center;
  background: var(--bg); border-top: 1px solid var(--border);
}
.land-cta-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.land-cta-sub { color: var(--text-2); font-size: 0.85rem; margin-bottom: 1.5rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem; text-align: center;
  font-size: 0.72rem; color: var(--text-3);
  font-family: var(--mono);
}

/* ── Database Schema ERD (Mermaid.js) ────────────────────────────────────── */
.erd-container {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 1.5rem;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  transition: border-color 0.2s ease;
}

.erd-container:hover {
  border-color: var(--border-h);
}

.erd-canvas {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

/* Custom styles to override Mermaid's SVG styling to perfectly fit the system style */
.erd-canvas svg {
  height: auto !important;
  max-height: 500px;
  background: transparent !important;
  font-family: var(--font) !important;
}

/* Polish typography and colors inside Mermaid SVG entities */
.erd-canvas svg .entityBox {
  fill: var(--bg-3) !important;
  stroke: var(--border-a) !important;
  stroke-width: 1.5px !important;
  rx: 4px;
  ry: 4px;
}

.erd-canvas svg .entityLabel {
  font-family: var(--font) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  fill: var(--text) !important;
}

.erd-canvas svg .attributeBoxOdd,
.erd-canvas svg .attributeBoxEven {
  fill: var(--bg-2) !important;
  stroke: var(--border) !important;
  stroke-width: 1px !important;
}

.erd-canvas svg .relationshipLine {
  stroke: var(--accent-purple) !important;
  stroke-width: 2px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 2px rgba(129, 140, 248, 0.2));
}

.erd-canvas svg .relationshipLabel {
  fill: var(--text-2) !important;
  font-family: var(--mono) !important;
  font-size: 0.7rem !important;
}


.spinner-box, .empty-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-2);
  margin-top: 1rem;
}
.empty-box p {
  font-size: 0.85rem;
}
.empty-desc {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem !important;
}
.empty-sub {
  font-size: 0.78rem !important;
  color: var(--text-3);
}

.ascii-view {
  margin-top: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 2rem 1rem; }
  .hero { padding: 5rem 1rem 3.5rem; }
  .hero-title { font-size: 1.75rem; }
  .endpoint-row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .endpoint-desc { font-family: var(--mono); font-size: 0.7rem; }
}
