/*
 * Shared by every page of the landing site: tokens, base, top bar, buttons and footer.
 * Page-specific layout stays in index.html (landing) and legal.css (versions, privacy, terms).
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Each colour token is light-dark(light, dark). color-scheme picks the side: the system setting by default,
   or the visitor's choice via data-theme (set by theme.js). */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

:root {
  --paper: light-dark(#f6f1e7, #10121c);
  --paper-2: light-dark(#efe8d9, #171a29);
  --ink: light-dark(#17150f, #eceefb);
  --ink-2: light-dark(#4a463b, #b3b7d1);
  --ink-3: light-dark(#6f6a5c, #8a8fae);
  --rule: light-dark(#d9d0bc, #2a2f48);
  --accent: light-dark(#5b4bdb, #a79bff);
  --accent-ink: light-dark(#ffffff, #0b0d17);
  /* Dark surfaces (the product frame, the download band). Dark in both themes; dark mode only shifts them a step darker. */
  --night: light-dark(#0b0d17, #080a12);
  --night-2: #151827;
  --frame-edge: light-dark(#17150f, #2a2f48);

  /* Corner radii. sm: chips, small images. md: buttons and small cards. lg: large cards and frames. pill: badges and icon buttons. */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Cascadia Code', Consolas, monospace;
  --wrap: 1120px;
}

body {
  font-family: var(--font-ui);
  font-size: 17px; line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-md);
}
.skip:focus { top: 12px; }

/* ── TOP BAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  letter-spacing: -0.3px; text-decoration: none; color: var(--ink);
}
.brand img { width: 28px; height: 28px; border-radius: var(--radius-sm); display: block; }

/*
 * ── BUTTONS ──
 * One .btn base plus a variant and, optionally, a size.
 *   .btn-primary  filled: the main action on a page (Download).
 *   .btn-outline  bordered, transparent: a secondary action (Star on GitHub, older versions).
 *   .btn-ghost    no border: navigation and low-emphasis actions (Features, Back to home, theme toggle).
 *   .btn-sm / .btn-lg change the size; .btn-icon makes a round icon-only button.
 * Variants only set the --btn-* properties, so a dark surface re-skins every button by redefining the colour tokens (see .download).
 */
.btn {
  --btn-bg: transparent; --btn-fg: var(--ink); --btn-border: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 15px/1 var(--font-ui);
  padding: 14px 22px; border-radius: var(--radius-md); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg);
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
/* Every variant reacts the same way: it turns to the accent colour (primary fills with it, outline and ghost take it as border or text over a faint tint) and lifts 1px. Flat while pressed; no movement if the visitor prefers reduced motion. */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

.btn-primary { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-border: var(--ink); }
.btn-primary:hover { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-border: var(--accent); }

.btn-outline { --btn-border: var(--rule); }
.btn-outline:hover { --btn-bg: color-mix(in srgb, var(--accent) 10%, transparent); --btn-fg: var(--accent); --btn-border: var(--accent); }

.btn-ghost { --btn-border: transparent; --btn-fg: var(--ink-2); }
.btn-ghost:hover { --btn-bg: color-mix(in srgb, var(--accent) 10%, transparent); --btn-fg: var(--accent); }

.btn-sm { padding: 10px 16px; font-size: 14px; }
.btn-lg { padding: 16px 26px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-pill); }

/* ── ICONS ──
   Tabler Icons from assets/icons.svg: <svg class="icon" aria-hidden="true"><use href="assets/icons.svg#name"/></svg>.
   Size follows the font size, colour follows the text colour. */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── FOOTER ── */
.site-footer { background: var(--paper); padding: 40px 0; border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-copy { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
}
