/*
 * QueryDog site. One stylesheet, no framework.
 *
 * The colours come from the app icon: its blue (#1376C9) and its green-blue (#00AD9D),
 * and the pale blue of the dog's ear (#BCEFF8). Type is the system's own, which on the
 * devices the app runs on is San Francisco; what the database says is set in monospace.
 */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f3f8fa;
  --surface-raised: #ffffff;
  --line: #dbe6ec;
  --text: #0c1f2c;
  --text-soft: #46606f;
  --accent: #1376c9;
  --accent-strong: #0e64ad;
  --on-accent: #ffffff;
  --link: #0e64ad;
  --teal: #00806f;
  --wash: rgba(188, 239, 248, 0.6);
  --null: #8296a3;
  --shadow: 0 1px 2px rgba(12, 31, 44, 0.06), 0 12px 40px -12px rgba(12, 31, 44, 0.22);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b151c;
    --surface: #121f29;
    --surface-raised: #172733;
    --line: #243744;
    --text: #e8f1f5;
    --text-soft: #9db3c1;
    --accent: #1b82d8;
    --accent-strong: #3a97e6;
    --link: #6cbcf5;
    --teal: #3fd0bd;
    --wash: rgba(19, 118, 201, 0.22);
    --null: #6f8696;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px -12px rgba(0, 0, 0, 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, picture { display: block; max-width: 100%; height: auto; }

h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
p + p { margin-top: 0.9em; }

a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }

.wrap {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 44rem; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
}
.skip:focus { top: 0.75rem; }

/* Top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { border-radius: 22.5%; }
.top-nav { display: flex; gap: 1.5rem; }
.top-nav a, .languages a {
  color: var(--text-soft);
  font-size: 0.9375rem;
  text-decoration: none;
}
.top-nav a:hover, .top-nav a[aria-current], .languages a:hover { color: var(--text); }
.languages {
  display: flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.languages a {
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.languages a[aria-current] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(12, 31, 44, 0.08);
}

@media (max-width: 40rem) {
  .top-row { gap: 1rem; }
  .top-nav { gap: 1rem; }
  .top-nav a:first-child { display: none; }
}
@media (max-width: 24rem) {
  .brand span { display: none; }
}

/* Hero */

.hero {
  position: relative;
  padding-top: clamp(3rem, 9vw, 6.5rem);
  text-align: center;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 44rem;
  z-index: -1;
  background:
    radial-gradient(60rem 30rem at 50% -8rem, var(--wash), transparent 70%);
  pointer-events: none;
}
.hero-icon {
  width: clamp(5rem, 12vw, 7rem);
  margin: 0 auto 1.75rem;
  border-radius: 22.5%;
  box-shadow: var(--shadow);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 500;
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--teal);
}
.hero h1 {
  max-width: 24ch;
  margin-inline: auto;
  font-size: clamp(2.25rem, 6.2vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.04;
}
.lead {
  max-width: 38rem;
  margin: 1.5rem auto 0;
  color: var(--text-soft);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.hero .signup, .hero .store { margin: 2.25rem auto 0; }

/* Sign-up form, and the button that takes its place */

.signup { max-width: 30rem; text-align: left; }
.signup-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.signup-row { display: flex; gap: 0.5rem; }
.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 2.875rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(12, 31, 44, 0.05);
}
.signup input[type="email"]::placeholder { color: var(--null); }
.signup input[type="email"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}
.signup button, .button {
  height: 2.875rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.signup button:hover, .button:hover { background: var(--accent-strong); }
.signup button[disabled] { opacity: 0.6; cursor: default; }
/* The field that is there for programs that fill in everything they find. */
.signup-extra {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.signup-note, .store-note {
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.signup-note a { color: inherit; }
.signup-status {
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.signup-status[data-kind="sent"] { border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); }
.signup-status[data-kind="error"] { border-color: color-mix(in srgb, #d6453d 55%, var(--line)); }
.signup[data-done] .signup-row, .signup[data-done] .signup-label { display: none; }

@media (max-width: 26rem) {
  .signup-row { flex-direction: column; }
  .signup input[type="email"] { flex: none; }
}

.store { text-align: center; }
.store-button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 1.4rem 0.6rem;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  line-height: 1.1;
  text-decoration: none;
}
.store-small { font-size: 0.75rem; }
.store-large { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }

/* Screenshots */

.shot-mac {
  max-width: 68rem;
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding-inline: var(--gutter);
}
.shot-mac img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  max-width: 54rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
}
.phones figure { margin: 0; }
.phones img { border-radius: clamp(14px, 3vw, 28px); box-shadow: var(--shadow); }
.phones figcaption {
  margin-top: 0.9rem;
  color: var(--text-soft);
  font-size: 0.875rem;
  text-align: center;
}
@media (max-width: 40rem) {
  /* Three phones side by side would be stamps: they go in a row that slides. */
  .phones {
    grid-template-columns: repeat(3, 62%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 1.5rem;
  }
  .phones figure { scroll-snap-align: center; }
}

/* Sections */

.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section + .section { padding-top: 0; }
.section-head { max-width: 40rem; }
.section-head.centered { margin-inline: auto; text-align: center; }
.section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.section-head p {
  margin-top: 1rem;
  color: var(--text-soft);
  font-size: 1.125rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/*
 * What the app does, laid out as the app lays out its own settings: a name on the left,
 * and beside it a box of rows with a line between them.
 */
.panes { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; gap: clamp(2rem, 4vw, 3rem); }
.pane {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.pane-name { position: sticky; top: 5rem; padding-top: 1.2rem; }
.pane-name h3 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.015em; }
.pane-name p { margin-top: 0.4rem; color: var(--text-soft); font-size: 0.9375rem; line-height: 1.45; }
.rows {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 1.1rem 1.35rem;
}
.row + .row { border-top: 1px solid var(--line); }
.row dt { font-weight: 600; font-size: 1rem; }
.row dd { margin: 0; color: var(--text-soft); font-size: 1rem; line-height: 1.55; }
.row dd code { color: var(--text); }

@media (max-width: 56rem) {
  .pane { grid-template-columns: minmax(0, 1fr); }
  .pane-name { position: static; padding-top: 0; }
}
@media (max-width: 36rem) {
  .row { grid-template-columns: minmax(0, 1fr); padding: 1rem 1.1rem; }
}

/* The table of what each export format writes: a result grid, as the app shows one. */

.grid-scroll {
  margin-top: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  overflow-x: auto;
}
.grid {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
}
.grid caption {
  caption-side: bottom;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 0.8125rem;
  text-align: left;
}
.grid th, .grid td { padding: 0.6rem 1rem; white-space: nowrap; }
.grid thead th {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
}
.grid tbody th { font-family: var(--sans); font-weight: 600; }
.grid tbody tr + tr > * { border-top: 1px solid var(--line); }
.grid th + th, .grid td { border-left: 1px solid var(--line); }
.grid .is-null { color: var(--null); font-style: italic; }
.grid .plain { font-family: var(--sans); color: var(--text-soft); }

/* Price */

.price-rows { max-width: 44rem; margin: clamp(2rem, 4vw, 3rem) auto 0; }
.price-rows .row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.price-rows dt span { display: block; color: var(--text-soft); font-size: 0.9375rem; font-weight: 400; line-height: 1.5; }
.price-rows dd { color: var(--text); font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; text-align: right; white-space: nowrap; }
.price-rows dd small { display: block; color: var(--text-soft); font-size: 0.8125rem; font-weight: 400; letter-spacing: 0; }
.price-note {
  max-width: 44rem;
  margin: 1rem auto 0;
  color: var(--text-soft);
  font-size: 0.875rem;
  text-align: center;
}
@media (max-width: 36rem) {
  .price-rows .row { grid-template-columns: minmax(0, 1fr); }
  .price-rows dd { text-align: left; }
}

/* The closing call */

.closing {
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.closing .signup, .closing .store { margin: 2rem auto 0; }
.closing .signup input[type="email"] { background: var(--bg); }

/* Support and privacy: text to read */

.doc { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem); }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.doc-intro { margin-top: 1.25rem; color: var(--text-soft); font-size: 1.1875rem; line-height: 1.5; text-wrap: pretty; }
.doc-meta { margin-top: 1rem; color: var(--text-soft); font-size: 0.875rem; }
.doc h2 {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.doc h3 { margin-top: 2.25rem; font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.doc h2 + *, .doc h3 + * { margin-top: 0.8rem; }
.doc h2 + h3 { margin-top: 1.75rem; }
.doc p, .doc li { text-wrap: pretty; }
.doc ul, .doc ol { margin: 0.9em 0 0; padding-left: 1.3rem; }
.doc li + li { margin-top: 0.4em; }
.doc pre {
  margin: 1rem 0 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}
.doc .rows { margin-top: 1.25rem; }
.doc .row dd { color: var(--text); }
.contact-card {
  margin-top: 2rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-card a { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }
.contact-card p + p { margin-top: 0.35rem; color: var(--text-soft); font-size: 0.9375rem; }

/* Answers to the form and to the links in the e-mails */

.message { padding-block: clamp(4rem, 12vw, 8rem); min-height: 60vh; }
.message h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.025em; }
.message p { margin-top: 1rem; color: var(--text-soft); font-size: 1.125rem; }
.message-detail { color: var(--text) !important; font-family: var(--mono); font-size: 1rem !important; overflow-wrap: anywhere; }
.message form { margin-top: 1.75rem; }

/* Foot */

.foot {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.875rem;
}
.foot-row { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.foot a { color: inherit; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.foot-legal { margin-top: 1.5rem; max-width: 48rem; font-size: 0.75rem; line-height: 1.5; opacity: 0.85; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* The list of what a page of text holds */

.doc-contents { margin-top: 2rem; }
.doc-contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.doc-contents li { margin: 0; }
.doc-contents a {
  display: block;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
}
.doc-contents a:hover { border-color: var(--accent); }
.doc section { scroll-margin-top: 4rem; }
mark { padding: 0 0.2em; border-radius: 4px; background: #d6453d; color: #fff; }
