/* QSP presentation site — one stylesheet, no build step. */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --surface: #ffffff;
  --fg: #1c2230;
  --muted: #5a6475;
  --border: #d7dbe2;
  --accent: #1d5fd1;
  --accent-fg: #ffffff;
  --direct: #1d5fd1;
  --radius: 10px;
  --maxw: 1040px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b;
    --bg-alt: #1a1e26;
    --surface: #1a1e26;
    --fg: #e6e9ef;
    --muted: #a3acba;
    --border: #343b48;
    --accent: #6ea2ff;
    --accent-fg: #0d1117;
    --direct: #6ea2ff;
  }
}

:root[data-theme="dark"] {
  --bg: #12151b;
  --bg-alt: #1a1e26;
  --surface: #1a1e26;
  --fg: #e6e9ef;
  --muted: #a3acba;
  --border: #343b48;
  --accent: #6ea2ff;
  --accent-fg: #0d1117;
  --direct: #6ea2ff;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw + 1rem, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 720px) {
  .wrap { padding-inline: 24px; }
}

/* Top navigation */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  min-height: 56px;
  padding-block: 8px;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
}
.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav ul a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.nav ul a:hover { color: var(--fg); }

/* Hero */
.hero {
  padding-block: 64px 32px;
  text-align: center;
}
.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40em;
  margin-inline: auto;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 1.5em 0 0;
}

.btn {
  display: inline-block;
  padding: 0.65em 1.3em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn-primary:hover { filter: brightness(1.08); }

/* Screenshot */
.screenshot { margin-block: 16px 48px; }
.screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.12);
}

/* Sections */
.section { padding-block: 48px; }
.section > h2 { text-align: center; margin-bottom: 1.25em; }

.tiles, .steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tile, .steps li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.tile p, .steps p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2em;
  height: 2em;
  margin-bottom: 0.6em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}
#get-started .actions { margin-top: 28px; }

/* How it works diagram */
.diagram {
  margin: 0 auto 32px;
  max-width: 820px;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--fg);
}
.diagram-narrow { display: none !important; max-width: 400px; margin-inline: auto; }
@media (max-width: 560px) {
  .diagram-wide { display: none !important; }
  .diagram-narrow { display: block !important; }
}
.diagram figcaption {
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
  font-size: 0.95rem;
}

.diagram text { fill: currentColor; font-family: inherit; }
.d-title { font-size: 18px; font-weight: 700; }
.d-strong { font-size: 17px; font-weight: 700; fill: var(--direct) !important; }
.d-label { font-size: 15px; font-weight: 600; }
.d-sub { font-size: 13px; fill: var(--muted) !important; }
.d-note { font-size: 14px; font-style: italic; fill: var(--muted) !important; }

.d-box {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 2;
}
.d-svc {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}
.d-dash {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-dasharray: 6 6;
}
.d-link {
  stroke: currentColor;
  stroke-width: 2;
}
.d-direct {
  stroke: var(--direct);
  stroke-width: 12;
  stroke-linecap: butt;
}
.d-head { fill: var(--direct); }

.explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.explain p { color: var(--muted); margin: 0; }

/* Open-source band */
.band {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
  margin-top: 32px;
}
.band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
  padding-block: 40px;
}
.band-inner > div { flex: 1 1 380px; }
.band-inner p { margin: 0; color: var(--muted); }
.band .actions { margin: 0; justify-content: flex-start; }

.footer {
  padding-block: 32px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.footer p { margin: 0; }
