/* Synth-Scale front door. Self-contained, system fonts only. */

:root {
  --bg: #ffffff;
  --bg-raise: #ffffff;
  --bg-inset: #f4f5f6;
  --text: #111214;
  --text-dim: #6b6f76;
  --border: #e3e5e8;
  --accent: #0d5fef;
  --accent-contrast: #ffffff;
  --accent-soft: #e8f0fe;
  --danger: #d92d20;
  --danger-soft: #fdeceb;
  --ok: #059669;
  --ok-soft: #e3f6ee;
  --code-bg: #16181c;
  --code-text: #e7e8ea;
  --code-comment: #8b8f96;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d0f;
    --bg-raise: #16181b;
    --bg-inset: #1c1e22;
    --text: #f2f3f4;
    --text-dim: #9a9ea5;
    --border: #2a2d32;
    --accent: #4f86ff;
    --accent-contrast: #0c0d0f;
    --accent-soft: #1a2c4d;
    --danger: #ff6b61;
    --danger-soft: #3a1815;
    --ok: #34d399;
    --ok-soft: #113228;
    --code-bg: #0a0b0d;
    --code-text: #e7e8ea;
    --code-comment: #7d8087;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }

h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 5.4vw, 3.4rem); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 1rem; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: -0.005em; margin: 0 0 0.6rem; }
h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
a { color: var(--accent); }
section { padding: 4rem 0; }
.kicker {
  font-family: var(--mono); font-size: 0.76rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
  margin: 0 0 0.9rem;
}
.section-sub { color: var(--text-dim); max-width: 46rem; margin: 0 0 1.5rem; }
.section-sub a { color: var(--accent); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 3.25rem; }
.brand { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.brand-accent { color: var(--accent); }
.site-nav { display: flex; gap: 1.1rem; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ---- hero ---- */
.hero { padding: 5.5rem 0 4rem; text-align: left; border-bottom: 1px solid var(--border); }
.hero .kicker { color: var(--accent); }
.tagline { font-size: 1.1rem; color: var(--text-dim); max-width: 44rem; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 2rem; }
.chip {
  font-family: var(--mono); font-size: 0.95rem;
  background: var(--code-bg); color: var(--code-text);
  padding: 0.55rem 0.9rem; border-radius: 6px;
  cursor: pointer; user-select: all;
  display: inline-flex; gap: 0.8rem; align-items: baseline;
  border: 1px solid var(--border);
}
.copy-hint { font-size: 0.72rem; color: var(--code-comment); text-transform: uppercase; letter-spacing: 0.06em; }
.chip.copied .copy-hint { color: var(--accent); }

/* ---- buttons ---- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 6px;
  padding: 0.55rem 1.1rem; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: var(--sans);
  transition: filter 120ms ease, opacity 120ms ease, border-color 120ms ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--bg-raise); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

/* ---- waitlist ---- */
.waitlist-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; max-width: 34rem; }
.waitlist-form input[type="email"] {
  flex: 1 1 14rem; padding: 0.55rem 0.8rem; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-raise); color: var(--text);
}
.waitlist-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.waitlist-msg { flex-basis: 100%; margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--ok); min-height: 1.2em; }
.waitlist-msg.err { color: var(--danger); }
.social-proof { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.6rem; }

/* ---- playground ---- */
.playground { background: var(--bg-inset); border-block: 1px solid var(--border); }
.controls {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: end;
  margin-bottom: 0.8rem;
}
.control { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.88rem; color: var(--text-dim); }
.control output { font-family: var(--mono); color: var(--text); margin-left: 0.4rem; }
.control input[type="range"] { width: 14rem; max-width: 60vw; accent-color: var(--accent); }
.control-seed input {
  width: 7rem; padding: 0.45rem 0.6rem; font-family: var(--mono); font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-raise); color: var(--text);
}
.control-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-left: auto; }

#ddl {
  width: 100%; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.9rem 1rem; resize: vertical; tab-size: 2;
}
#ddl:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- source tabs (Paste DDL / Connect a database) ---- */
.source-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.source-tab {
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.5rem 0.9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.source-tab:hover { color: var(--text); }
.source-tab.active {
  background: var(--bg-raise); color: var(--accent); border-color: var(--accent);
}
.beta-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 0.1em 0.5em;
}
.source-panel { margin-bottom: 0.8rem; }
.db-url-input {
  width: 100%; font-family: var(--mono); font-size: 0.9rem;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.db-url-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.db-url-hint { color: var(--text-dim); font-size: 0.82rem; margin: 0.5rem 0 0; }
.db-url-hint a { color: var(--accent); }

/* ---- trust box: the reassurance a caller needs to see BEFORE they type a
   real credential into the password field below, not buried after it ---- */
.trust-box {
  background: var(--ok-soft); border: 1px solid var(--ok); border-radius: 8px;
  padding: 0.9rem 1.1rem; margin-bottom: 0.9rem;
}
.trust-box-title { margin: 0 0 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.trust-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.trust-box li { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.trust-check { color: var(--ok); font-weight: 700; margin-right: 0.15rem; }
.trust-box code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-inset); padding: 0.05em 0.3em; border-radius: 4px; }
.trust-box a { color: var(--accent); }

.error {
  background: var(--danger-soft); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 6px; padding: 0.6rem 0.9rem; font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.verdict {
  font-family: var(--mono); font-size: 0.9rem; font-weight: 600;
  color: var(--ok); background: var(--ok-soft);
  border-radius: 6px; padding: 0.55rem 0.9rem; display: block;
}
.verdict.bad { color: var(--danger); background: var(--danger-soft); }

.results { display: grid; gap: 1.4rem; margin-top: 1rem; }
.table-block { min-width: 0; }
.table-block h3 {
  font-family: var(--mono); font-size: 0.95rem; margin-bottom: 0.4rem;
}
.table-block h3 .rowcount { color: var(--text-dim); font-weight: 400; font-size: 0.82rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-raise); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.82rem; font-family: var(--mono); }
table.data th, table.data td {
  padding: 0.35rem 0.7rem; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data th { background: var(--bg-inset); color: var(--text-dim); font-weight: 600; position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: none; }
td.null { color: var(--text-dim); font-style: italic; }

/* ---- why (numbered editorial list) ---- */
.why-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.why-item {
  display: grid; grid-template-columns: 3rem 1fr; gap: 1.3rem;
  padding: 1.7rem 0; border-bottom: 1px solid var(--border);
}
.why-num { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); padding-top: 0.2rem; }
.why-item h3 { font-size: 1.12rem; }
.why-item p { margin: 0; color: var(--text-dim); font-size: 0.94rem; max-width: 42rem; }
.why-item code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-inset); padding: 0.05em 0.3em; border-radius: 4px; }

/* ---- compare ---- */
.compare { border-top: 1px solid var(--border); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.compare-col { border-radius: 10px; padding: 1rem; min-width: 0; }
.compare-bad { background: var(--danger-soft); border: 1px solid var(--danger); }
.compare-good { background: var(--ok-soft); border: 1px solid var(--ok); }
.compare-label {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; margin: 0 0 0.7rem;
}
.compare-bad .compare-label { color: var(--danger); }
.compare-good .compare-label { color: var(--ok); }
.compare-col .codeblock { margin-bottom: 0.7rem; font-size: 0.78rem; }
.compare-col .codeblock:last-of-type { margin-bottom: 0; }
.compare-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.compare-ok-note { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.compare-ok-note code {
  font-family: var(--mono); font-size: 0.85em; background: var(--bg-raise);
  padding: 0.05em 0.3em; border-radius: 4px;
}

/* ---- cli ---- */
.codeblock {
  background: var(--code-bg); color: var(--code-text);
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.6;
  border-radius: 8px; border: 1px solid var(--border);
  padding: 1rem 1.2rem; overflow-x: auto; margin: 0 0 1.2rem;
}
.codeblock .c { color: var(--code-comment); }

/* ---- proof ---- */
.proof { border-top: 1px solid var(--border); background: var(--bg-inset); }
.proof-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.9rem;
  margin: 1.2rem 0 1.6rem;
}
.proof-stat {
  display: flex; flex-direction: column; gap: 0.2rem;
  background: var(--ok-soft); border: 1px solid var(--ok); border-radius: 8px;
  padding: 0.9rem 1rem;
}
.proof-num { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--ok); }
.proof-label { font-size: 0.8rem; color: var(--text-dim); }
.section-sub code, .db-url-hint code {
  font-family: var(--mono); font-size: 0.85em; background: var(--bg-inset);
  padding: 0.05em 0.3em; border-radius: 4px;
}
/* .proof itself sits on --bg-inset, so its own inline code chips need the
   raised (white) surface instead -- otherwise chip and section background
   are literally the same color and the chip disappears. */
.proof .section-sub code, .proof .db-url-hint code { background: var(--bg-raise); }

/* ---- faq (native <details>/<summary> accordion, no JS needed) ---- */
.faq { border-top: 1px solid var(--border); }
.faq-list { border-top: 1px solid var(--border); max-width: 42rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0; cursor: pointer; font-size: 0.98rem; font-weight: 600; color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none; font-family: var(--mono); font-size: 1.1rem; font-weight: 400;
  color: var(--text-dim); transition: transform 0.15s ease;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-item p { margin: 0 0 1.1rem; color: var(--text-dim); font-size: 0.92rem; max-width: 38rem; }
.faq-item code { font-family: var(--mono); font-size: 0.85em; background: var(--bg-inset); padding: 0.05em 0.3em; border-radius: 4px; }
.faq-item a { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after { transition: none; }
}

/* ---- feedback ---- */
.feedback { border-top: 1px solid var(--border); background: var(--bg-inset); }
.feedback-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 34rem; }
.feedback-choice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  border: 0; padding: 0; margin: 0;
}
.feedback-choice legend {
  width: 100%; padding: 0 0 0.5rem; font-size: 0.88rem; color: var(--text-dim);
}
.choice-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.92rem; color: var(--text); cursor: pointer;
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.5rem 1.1rem 0.5rem 0.9rem;
}
.choice-pill input { margin: 0; accent-color: var(--accent); cursor: pointer; }
/* :has() is a progressive enhancement (highlights the whole pill on
   selection in current browsers); the native radio dot next to the label
   is always visible on its own, so selection state never depends on it. */
.choice-pill:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.choice-pill:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.feedback-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; color: var(--text-dim); }
.feedback-field em { font-style: normal; color: var(--text-dim); }
.feedback-field input, .feedback-field textarea {
  font-family: var(--sans); font-size: 0.95rem; color: var(--text);
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.8rem; resize: vertical;
}
.feedback-field input:focus, .feedback-field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.feedback-msg { margin: 0; font-size: 0.9rem; color: var(--ok); min-height: 1.2em; }
.feedback-msg.err { color: var(--danger); }

/* ---- contact ---- */
.contact { border-top: 1px solid var(--border); }
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 34rem; }
.contact-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.88rem; color: var(--text-dim); }
.contact-field em { font-style: normal; color: var(--text-dim); }
.contact-field input, .contact-field textarea {
  font-family: var(--sans); font-size: 0.95rem; color: var(--text);
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.8rem; resize: vertical;
}
.contact-field input:focus, .contact-field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.contact-msg { margin: 0; font-size: 0.9rem; color: var(--ok); min-height: 1.2em; }
.contact-msg.err { color: var(--danger); }

/* ---- bottom cta / footer ---- */
.bottom-cta { background: var(--bg-inset); border-top: 1px solid var(--border); }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2.5rem; }
.site-footer p { color: var(--text-dim); font-size: 0.85rem; max-width: 46rem; }

@media (max-width: 640px) {
  .site-nav { gap: 0.7rem; }
  .site-nav a:nth-child(2) { display: none; }
  .hero { padding-top: 3rem; }
  .control-buttons { margin-left: 0; }
  .why-item { grid-template-columns: 2rem 1fr; gap: 0.9rem; }
  .compare-grid { grid-template-columns: 1fr; }
}

/* ---- stats dashboard (private, unlinked) ---- */
.stats-page { padding: 3rem 0 4rem; }
.stats-key-row { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 34rem; margin-bottom: 1.5rem; }
.stats-key-row input {
  flex: 1 1 12rem; font-family: var(--mono); font-size: 0.9rem; color: var(--text);
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.55rem 0.8rem;
}
.stats-key-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.stats-body h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.stat-tile {
  display: flex; flex-direction: column; gap: 0.2rem;
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.9rem 1rem;
}
.stat-num { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-dim); }
.stat-tile.ok { border-color: var(--ok); }
.stat-tile.ok .stat-num { color: var(--ok); }
.stat-tile.bad { border-color: var(--danger); }
.stat-tile.bad .stat-num { color: var(--danger); }

.feedback-count { font-family: var(--mono); font-size: 0.85rem; font-weight: 400; color: var(--text-dim); }
.feedback-list { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1rem; }
.feedback-response {
  border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1rem;
  background: var(--bg-raise);
}
.feedback-response-head {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim);
}
.would-use-pill {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.1em 0.55em; border-radius: 999px; font-size: 0.72rem;
}
.would-use-pill.yes { background: var(--ok-soft); color: var(--ok); }
.would-use-pill.maybe { background: var(--bg-inset); color: var(--text-dim); }
.would-use-pill.no { background: var(--danger-soft); color: var(--danger); }
.feedback-response dl { margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.feedback-response dt { font-size: 0.72rem; color: var(--text-dim); margin: 0; }
.feedback-response dd { font-size: 0.88rem; color: var(--text); margin: 0 0 0.3rem; }
