/* QueryMoat site. Colours from the logo: night-navy banks, bright blue water between them. */
:root {
  --stone: #eef2f8;
  --stone-deep: #dde5f0;
  --rule: #bcc7d8;
  --ink: #111c2b;
  --ink-soft: #46546a;
  --moat: #15233a;
  --moat-deep: #0c1824;
  --current: #2f7cf0;
  --foam: #d8e4fc;
  --stop: #c0392b;
  --stop-soft: #f6d9d5;
  --pass: #2e7d5b;

  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 48px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: 'wdth' 100;
}

a { color: var(--moat); text-underline-offset: 0.18em; }
a:hover { color: var(--moat-deep); }

:focus-visible {
  outline: 3px solid var(--current);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

p code, li code, summary code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--stone-deep); padding: 0.1em 0.35em; border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--stone); padding: 8px 12px;
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

/* ---------- Header ---------- */
.site-header { background: var(--moat); color: var(--foam); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.25rem;
  font-variation-settings: 'wdth' 112;
}
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.brand:hover { color: #fff; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 28px); }
.site-nav a { color: var(--foam); text-decoration: none; font-size: 1rem; }
.site-nav a:hover { color: #fff; text-decoration: underline; }
.site-nav .nav-install {
  color: var(--moat-deep); background: var(--foam);
  padding: 8px 16px; border-radius: 6px; font-weight: 600;
}
.site-nav .nav-install:hover { background: #fff; color: var(--moat-deep); text-decoration: none; }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } }

/* ---------- Hero: the moat ---------- */
.hero { background: var(--moat); color: var(--foam); padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero-grid {
  display: grid; gap: clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; } }

.hero h1 {
  margin: 0; color: #fff;
  font-size: clamp(2.2rem, 4.3vw, 3.6rem);
  line-height: 1.05;
  font-weight: 750;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.01em;
  max-width: 17ch;
}
.hero .lede { margin: 24px 0 0; max-width: 46ch; font-size: 1.2rem; color: var(--foam); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-block; text-decoration: none; font-weight: 650;
  padding: 13px 22px; border-radius: 8px; font-size: 1.05rem; line-height: 1.2;
}
.button-primary { background: #fff; color: var(--moat-deep); }
.button-primary:hover { background: var(--foam); color: var(--moat-deep); }
.button-quiet { color: #fff; box-shadow: inset 0 0 0 2px rgba(216, 228, 252, 0.55); }
.button-quiet:hover { color: #fff; box-shadow: inset 0 0 0 2px #fff; }
.hero .small-print { margin: 20px 0 0; font-size: 0.95rem; color: rgba(216, 228, 252, 0.82); }

/* The live moat: agent bank | water | database bank */
.moat {
  background: var(--stone); color: var(--ink);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(4, 10, 22, 0.75);
}
.moat-banks {
  display: grid; grid-template-columns: 1fr 44px 0.62fr;
  font-size: 0.95rem; font-weight: 600; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}
.moat-banks span { padding: 12px 16px; }
.moat-banks .water { padding: 0; background: var(--current); }
.moat-row {
  display: grid; grid-template-columns: 1fr 44px 0.62fr;
  border-bottom: 1px solid var(--stone-deep);
}
.moat-row:last-child { border-bottom: 0; }
.moat-row code {
  display: block; padding: 14px 16px;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.moat-row .water {
  position: relative; background: var(--current);
  display: grid; place-items: center;
}
/* A read crosses: a line runs over the water. */
.moat-row.read .water::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; background: #fff; transform-origin: left center;
}
/* A write stops: a red bar on the near bank of the water. */
.moat-row.write .water::before {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 4px; background: var(--stop);
}
.result { padding: 14px 16px; font-size: 0.9rem; color: var(--pass); font-weight: 600; }
.moat-row.write .result { color: var(--ink-soft); font-weight: 400; }
.rejection {
  grid-column: 1 / -1;
  margin: 0; padding: 10px 16px 14px;
  background: var(--stop-soft); color: #7a1f16;
  font-family: var(--mono); font-size: 0.76rem; line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .moat-banks, .moat-row { grid-template-columns: 1fr 28px 0.75fr; }
  .moat-row code { font-size: 0.74rem; padding: 12px; }
  .result { padding: 12px; font-size: 0.82rem; }
}

/* One orchestrated moment: queries arrive in order, the write stops. */
@media (prefers-reduced-motion: no-preference) {
  .js .moat-row { opacity: 0; transform: translateX(-12px); }
  .js .moat-row.shown { opacity: 1; transform: none; transition: opacity 0.35s ease, transform 0.35s ease; }
  .js .moat-row.read .water::before { transform: scaleX(0); }
  .js .moat-row.read.shown .water::before { transform: scaleX(1); transition: transform 0.45s 0.2s ease-out; }
  .js .moat-row.write .rejection { opacity: 0; }
  .js .moat-row.write.shown .rejection { opacity: 1; transition: opacity 0.3s 0.45s ease; }
}

/* ---------- Sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; }
section + section { border-top: 1px solid var(--rule); }
h2 {
  margin: 0 0 12px; color: var(--moat-deep);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.12;
  font-weight: 720; font-variation-settings: 'wdth' 112;
}
.section-intro { margin: 0 0 40px; max-width: var(--measure); color: var(--ink-soft); }
h3 { margin: 0 0 6px; font-size: 1.2rem; line-height: 1.3; font-weight: 680; color: var(--ink); }
p { max-width: var(--measure); }

/* Guarantees: a rail of water beside each claim, not cards. */
.guarantees { display: grid; gap: 36px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .guarantees { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.guarantees li { border-left: 4px solid var(--current); padding-left: 20px; }
.guarantees p { margin: 0; color: var(--ink-soft); font-size: 1.05rem; }

/* Setup is a real sequence, so it is numbered. */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; max-width: 760px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--moat); color: #fff; font-weight: 700;
}
.steps p { margin: 0; color: var(--ink-soft); }
.steps li > div { min-width: 0; } /* lets a long command scroll instead of widening the page */

.codeblock {
  position: relative; margin: 14px 0 0;
  background: var(--moat-deep); color: var(--foam);
  border-radius: 8px; padding: 14px 16px; padding-right: 88px;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.6;
  overflow-x: auto; white-space: pre;
}
.codeblock code { background: none; padding: 0; font-size: inherit; color: inherit; border-radius: 0; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font: 600 0.8rem var(--sans); color: var(--moat-deep); background: var(--foam);
  border: 0; border-radius: 5px; padding: 6px 10px; cursor: pointer;
}
.copy:hover { background: #fff; }

.works { display: grid; gap: 28px; }
@media (min-width: 760px) { .works { grid-template-columns: 1fr 1fr; } }
.works p { margin: 4px 0 0; font-size: 1.15rem; }

/* ---------- Pricing ---------- */
.plans {
  width: 100%; border-collapse: collapse; margin-top: 8px;
  font-size: 1rem;
}
.plans-scroll { overflow-x: auto; }
.plans th, .plans td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.plans thead th { border-bottom: 2px solid var(--moat); vertical-align: top; }
.plans thead .plan-name { display: block; font-size: 1.35rem; font-weight: 720; color: var(--moat-deep); font-variation-settings: 'wdth' 110; }
.plans thead .price { display: block; margin-top: 4px; font-size: 1rem; font-weight: 600; color: var(--ink); }
.plans thead .price-note { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.92rem; }
.plans tbody th { font-weight: 500; color: var(--ink); width: 46%; }
.plans td { width: 18%; color: var(--ink-soft); }
.yes { color: var(--pass); font-weight: 700; }
.soon { font-size: 0.9rem; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 600px) {
  .plans { font-size: 0.92rem; }
  .plans th, .plans td { padding: 12px 6px; }
  .plans tbody th { width: auto; }
  .plans td { width: auto; white-space: nowrap; }
  .plans thead .plan-name { font-size: 1.15rem; }
}
.button-moat { background: var(--moat); color: #fff; }
.button-moat:hover { background: var(--moat-deep); color: #fff; }
.button-outline { color: var(--moat); box-shadow: inset 0 0 0 2px var(--moat); }
.button-outline:hover { color: var(--moat-deep); box-shadow: inset 0 0 0 2px var(--moat-deep); }
.founding {
  margin-top: 32px; padding: 20px 24px; max-width: 760px;
  background: var(--foam); border-left: 4px solid var(--moat); border-radius: 0 8px 8px 0;
}
.founding p { margin: 0; }
.team-plan { margin-top: 32px; max-width: 760px; }
.team-plan p { margin: 0; color: var(--ink-soft); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 650; font-size: 1.1rem; }
.faq details p { margin: 12px 0 0; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--moat-deep); color: var(--foam); padding: 40px 0; font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.site-footer a { color: var(--foam); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer p { margin: 0; }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(40px, 6vw, 72px) 0 96px; }
.legal h1 {
  margin: 0 0 8px; color: var(--moat-deep);
  font-size: clamp(2rem, 4vw, 2.8rem); font-variation-settings: 'wdth' 114; line-height: 1.1;
}
.legal .updated { margin: 0 0 32px; color: var(--ink-soft); }
.legal h2 { font-size: 1.35rem; margin-top: 36px; }
.legal ul { max-width: var(--measure); padding-left: 1.2em; }
.legal li { margin: 6px 0; }
