/* The DRONAGE manual site. Adapted from euclidtrack's neocities style.css
   (provenance in README.md here): its dark first tokens and layout, with
   DRONAGE's own type, Inter for the text and Bebas Neue (the panel's caption
   font) for the headings. Light theme through prefers-color-scheme. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter/Inter.woff2") format("woff2");
  font-weight: 100 900; /* one variable file holds every weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bebas Neue";
  src: url("fonts/bebas_neue/BebasNeue-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0e11;
  --panel: #14171c;
  --panel-2: #1b1f26;
  --border: #2a2f38;
  --text: #c9d1d9;
  --text-dim: #8b949e;
  --head: #f0f3f6;
  --accent: #46c26a;
  --link: #7fd39a;
  --code-bg: #0a0c0f;
  --maxw: 820px;
  --text-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --head-font: "Bebas Neue", "Inter", system-ui, sans-serif;
  --mono-font: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-2: #eef1f4;
    --border: #d6dbe0;
    --text: #2b3038;
    --text-dim: #5b636d;
    --head: #10131a;
    --accent: #1f9d4d;
    --link: #157a3a;
    --code-bg: #f0f2f5;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 64px; /* clear the sticky top bar on anchor jumps */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  font-size: 17px;
  line-height: 1.65;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}
.topbar a {
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.topbar a:hover { color: var(--head); text-decoration: none; }

/* The rendered chapter */
.doc {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 96px;
}

/* Bebas Neue comes in one weight here: 400 keeps the browser from faking a bold. */
.doc h1, .doc h2, .doc h3, .doc h4 {
  color: var(--head);
  font-family: var(--head-font);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin: 1.6em 0 0.5em;
}
.doc h1 { font-size: 3em; margin-top: 0.2em; }
.doc h2 {
  font-size: 2em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--border);
}
.doc h3 { font-size: 1.5em; }
.doc h1 + p, .doc h2 + p { margin-top: 0.4em; }

/* The "On this page" box (built by viewer.js) */
.doc .toc {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px 16px;
  margin: 1.6em 0 2.4em;
}
.doc .toc summary {
  cursor: pointer;
  color: var(--head);
  font-family: var(--head-font);
  font-size: 1.2em;
  letter-spacing: 0.06em;
  padding: 4px 0;
}
.doc .toc ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  columns: 16em;
  column-gap: 32px;
}
.doc .toc li {
  break-inside: avoid;
  margin: 3px 0;
  line-height: 1.45;
}
.doc .toc li.toc-3 { padding-left: 16px; font-size: 0.92em; }
.doc .toc li.toc-3 a { color: var(--text-dim); }
.doc .toc li a:hover { color: var(--accent); }

.doc p, .doc li { color: var(--text); }
.doc strong { color: var(--head); }

.doc code {
  font-family: var(--mono-font);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
}
.doc pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.45;
}
.doc pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.86em;
  white-space: pre;
}

.doc img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.doc blockquote {
  margin: 1.2em 0;
  padding: 0.2em 1em;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

/* Tables scroll inside their own box on narrow screens. */
.doc table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95em;
}
.doc th, .doc td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
}
.doc thead th { background: var(--panel-2); color: var(--head); }
.doc tbody tr:nth-child(even) { background: var(--panel); }

/* Previous and next (built by viewer.js) */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 3em;
  padding-top: 1.6em;
  border-top: 1px solid var(--border);
}
.pager a {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .next { grid-column: 2; text-align: right; }
.pager-dir {
  display: block;
  color: var(--text-dim);
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pager-title { display: block; color: var(--head); font-weight: 600; }

.error { color: #e5534b; }

/* The landing page */
.home {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18vh 20px 80px;
  text-align: center;
}
.home .splash {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 28px;
}
.home h1 {
  color: var(--head);
  font-family: var(--head-font);
  font-weight: 400;
  font-size: 5em;
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 0 0 0.1em;
}
.home .tagline {
  color: var(--text-dim);
  font-size: 1.2em;
  max-width: 60ch;
  margin: 0 auto 2em;
}
.manuals {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.manuals a {
  flex: 1 1 260px;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}
.manuals a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.manuals .m-title {
  display: block;
  color: var(--head);
  font-family: var(--head-font);
  font-size: 1.6em;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.manuals .m-sub { display: block; color: var(--text-dim); font-size: 0.92em; }

/* ---- The signal flow diagrams (inline SVG in 10-signal-flow.md) ---- */
figure.flow { margin: 26px 0; }
figure.flow svg { display: block; width: 100%; height: auto; }
.flow .box { fill: var(--panel); stroke: var(--border); stroke-width: 1.2; }
.flow .end { fill: var(--panel-2); stroke: var(--accent); stroke-width: 1.2; }
.flow .name { font-family: var(--head-font); font-size: 17px; letter-spacing: 0.05em; fill: var(--head); }
.flow .small { font-family: var(--head-font); font-size: 14px; letter-spacing: 0.05em; fill: var(--head); }
.flow .note { font-family: var(--text-font); font-size: 13px; fill: var(--text-dim); }
.flow .wire { stroke: var(--accent); stroke-width: 1.6; fill: none; }
.flow .wire.dim { stroke: var(--text-dim); stroke-dasharray: 5 4; stroke-width: 1.3; }
.flow .head { fill: var(--accent); }
.flow .head.dim { fill: var(--text-dim); }
.flow .tap { fill: var(--accent); }
