/* BSFChat landing — dark theme, no framework */

/* Self-hosted, deliberately.
 *
 * This site tells visitors it does not track them, so it must not hand
 * their IP address to a third party to render its own text. A
 * <link href="fonts.googleapis.com"> does exactly that: every visitor's
 * IP, User-Agent and Referer reach Google before a single word is
 * drawn, which is also why a German court found embedded Google Fonts
 * to be an unlawful transfer of personal data (LG München I, 3 O
 * 17493/20). One 70 KB file served from our own origin removes the
 * whole problem, and removes the round trip as well.
 *
 * Geist rather than Inter because it is the typeface the desktop and
 * mobile clients already ship (client/qml/fonts/Geist-Variable.ttf), so
 * the site and the app now look like the same product — and because it
 * was already vetted and licensed in this project. SIL Open Font
 * License 1.1; the licence text ships beside the font at
 * /fonts/OFL.txt, which is what the OFL requires.
 *
 * One variable font covers every weight the site uses (400-700), so
 * this is a single request, not four. font-display: swap keeps text
 * visible while it loads; the system stack below is what renders in
 * that window and is close enough in metrics not to reflow badly.
 */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-0: #1e1f22;
  --bg-1: #2b2d31;
  --bg-2: #313338;
  --text: #f2f3f5;
  --text-muted: #b5bac1;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --border: rgba(255, 255, 255, 0.06);
  --warn: #faa61a;
  --radius: 12px;
  --max: 1040px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg-2);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

pre {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}

pre code { background: transparent; padding: 0; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(30, 31, 34, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; }

.brand-glyph {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-word { font-size: 1.05rem; }

.site-nav { display: flex; gap: 1.2rem; font-size: 0.95rem; color: var(--text-muted); }
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }

/* Sections */
section { padding: 4rem 0; }

h1, h2, h3 { margin: 0 0 0.6em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

p { color: var(--text-muted); margin: 0 0 1rem; }

.lede { font-size: 1.15rem; max-width: 40rem; margin-bottom: 2rem; }
.section-lede { max-width: 40rem; margin-bottom: 2rem; }

.hero { padding: 5rem 0 4rem; }
.hero h1 { max-width: 18ch; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-1);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Tiles */
.tiles {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.5rem;
}

.tile {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tile:hover { border-color: var(--accent); }
.tile h3 { margin-bottom: 0.4rem; }
.tile p { margin: 0; font-size: 0.95rem; }

.tile-link { display: block; }
.tile-link:hover { transform: translateY(-2px); }

.download-file {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.download-version { font-size: 0.8rem; color: var(--text-muted); margin: 0; opacity: 0.75; }
.download-meta { margin-top: 1.5rem; font-size: 0.95rem; }
.download-meta a { color: var(--accent); }

.self-host p { max-width: 44rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 540px) {
  /* Four nav links no longer fit beside the wordmark, so let the nav drop
     to its own line rather than letting the last one clip off the edge. */
  .header-inner { flex-wrap: wrap; row-gap: 0.5rem; }
  .site-nav { gap: 0.9rem; font-size: 0.9rem; flex-wrap: wrap; }
  section { padding: 3rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }

/* ---------------------------------------------------------------------------
   Document pages (/privacy, /terms, /support)
   Long-form prose. Same tokens as the landing page — no new colours.
   --------------------------------------------------------------------------- */

.doc { padding: 3rem 0 4rem; }
.doc .container { max-width: 46rem; }

.doc h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.4em; }
.doc h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc h3 { font-size: 1.05rem; margin-top: 1.8rem; }
.doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 2rem; }

.doc p, .doc li { color: var(--text-muted); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul, .doc ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.doc li { margin-bottom: 0.5rem; }
.doc a { color: var(--accent); }
.doc a:hover { text-decoration: underline; }

.doc-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.8;
  margin-bottom: 2rem;
}

/* Callouts. .doc-note is the neutral one; .doc-note-review is the
   "an AI drafted this, a human has not signed it off" banner. */
.doc-note {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-left-width: 4px;
  border-left-color: var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0 0 2rem;
}
.doc-note p:last-child { margin-bottom: 0; }
.doc-note h2, .doc-note h3 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--text);
}

.doc-note-review { border-left-color: var(--warn); }
.doc-note-review h2 { font-size: 1.1rem; }

/* Inline marker for a sentence the owner must confirm before publishing. */
.review-flag {
  color: var(--warn);
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Tables — used for the "what is stored" summaries. */
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.doc th { color: var(--text); font-weight: 600; }
.doc thead tr { border-bottom: 2px solid var(--border); }
.doc tbody tr:last-child td { border-bottom: 0; }

.doc-table-wrap { overflow-x: auto; }

/* The "what we do not collect" list — visually distinct from prose. */
.doc-nope { list-style: none; padding-left: 0; }
.doc-nope li {
  padding-left: 1.6rem;
  position: relative;
}
.doc-nope li::before {
  content: "×";
  position: absolute;
  left: 0.35rem;
  top: -0.05rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15em;
}

@media (max-width: 540px) {
  .doc { padding: 2rem 0 3rem; }
  .doc th, .doc td { padding: 0.5rem 0.5rem; font-size: 0.9rem; }
}
