/*
 * Machine Quotient base kit: theme, fonts and the standard navbar.
 *
 * Every standalone page on the site (anything under public/) includes:
 *
 *   <link rel="stylesheet" href="/mq/base.css">
 *   <script src="/mq/base.js"></script>
 *
 * base.js adds the MQ favicon, applies the saved theme and puts the
 * MQ navbar (brand + light/dark toggle) at the top of the page.
 * Start new pages from templates/page.html.
 *
 * The colour tokens match src/index.css (the React home page).
 * Page-specific styles go in the page's own <style> block.
 * A page can widen the navbar with  :root { --mq-width: 960px; }
 */

@font-face { font-family: 'Plus Jakarta Sans'; src: url('/fonts/PlusJakartaSans-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/fonts/PlusJakartaSans-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --bg: #16181d;
  --bg-2: #1d2027;
  --bg-3: #23272f;
  --fg: #f1f3f5;
  --fg-2: #b7bcc5;
  --fg-3: #7d8391;
  --line: rgba(241, 243, 245, 0.1);
  --accent: #22c7d6;
  --accent-2: #0e9fad;
  --accent-soft: rgba(34, 199, 214, 0.14);
  --font: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mq-width: 720px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f4f5f7;
  --bg-2: #ffffff;
  --bg-3: #e9ebef;
  --fg: #16181d;
  --fg-2: #464b56;
  --fg-3: #6e7482;
  --line: rgba(22, 24, 29, 0.1);
  --accent: #0e9fad;
  --accent-2: #0b8391;
  --accent-soft: rgba(14, 159, 173, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ---------- Navbar ---------- */
mq-nav {
  display: block;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font: 16px/1.65 var(--font);
}
/* Reserve the bar's height until base.js fills it, so the page doesn't jump. */
mq-nav:empty { min-height: 73px; }
mq-nav .mq-bar {
  max-width: var(--mq-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
mq-nav .mq-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 20px;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}
mq-nav .mq-logo:hover { color: var(--fg); }
mq-nav .mq-bracket { color: var(--accent); font-weight: 800; }
mq-nav .mq-logo b { font-weight: 800; }
mq-nav .mq-light { font-weight: 400; }
mq-nav .mq-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
mq-nav .mq-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
mq-nav .mq-moon { display: none; }
:root[data-theme='light'] mq-nav .mq-sun { display: none; }
:root[data-theme='light'] mq-nav .mq-moon { display: block; }

@media (prefers-reduced-motion: reduce) {
  mq-nav .mq-toggle { transition: none; }
}
