/* Stars Reborn — the site's one stylesheet: the front page and the documentation pages.
 *
 * Tokens, base and nav were extracted verbatim from the old index.html by
 * tools/ (see the scratch generator noted in docs/dev/build-and-release.md)
 * so the doc pages cannot drift away from the marketing page's palette.
 * roadmap.html keeps its inline stylesheet: it carries substantial
 * page-specific CSS (print rules) that the doc pages have no use for.
 * The front page (tools/site_proposal/, built by build_docs.py --proposal)
 * uses this file too (d3-6: one site); its own block is the FRONT PAGE banner
 * at the end. roadmap.html copies the BACKDROP block into its inline sheet.
 *
 * Everything below the DOC PAGES banner is written for those pages only.
 */

:root {
  --bg-0: #070a11;
  --bg-1: #080c14;
  --bg-2: #0c1220;
  --bg-3: #0e1526;
  --line: rgba(192, 216, 255, 0.09);
  --line-strong: rgba(192, 216, 255, 0.18);
  --line-faint: rgba(192, 216, 255, 0.05);
  --ink: #c0d8ff;
  --ink-dim: #8a9cbf;
  --ink-faint: #6d7e9f;
  --ink-ghost: #3a485f;
  --teal: oklch(0.80 0.12 195);
  --teal-dim: oklch(0.55 0.10 195);
  --teal-glow: oklch(0.80 0.12 195 / 0.15);
  --violet: oklch(0.72 0.14 300);
  --amber: oklch(0.84 0.12 80);
  --rose: oklch(0.72 0.15 15);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body::before {
  /* scanline overlay */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(192, 216, 255, 0.018) 0,
      rgba(192, 216, 255, 0.018) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: screen;
}

/* ---------- BACKDROP (every page, d3-6) ----------
 * The front page's starfield tile and nebula washes, under the scanline
 * overlay. Blocks that carry text keep their --bg-* fill at --veil opacity,
 * so the stars show between blocks and never behind text. */
:root {
  --veil: 0.85;
  --panel: rgba(12, 18, 32, var(--veil));    /* --bg-2 */
  --panel-1: rgba(8, 12, 20, var(--veil));   /* --bg-1 */
  --panel-0: rgba(7, 10, 17, var(--veil));   /* --bg-0 */
}
html {
  background: var(--bg-1) url("starfield.svg") repeat;
  background-size: 600px 600px;
}
.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(90, 60, 160, 0.22), transparent 70%),
    radial-gradient(50% 40% at 80% 70%, rgba(40, 120, 150, 0.18), transparent 70%),
    radial-gradient(40% 40% at 60% 15%, rgba(160, 80, 110, 0.10), transparent 70%);
}
/* The text column of the doc pages (guide, reference, known issues;
   changelog's log) is one veiled panel; the stars show beside it. */
.container:has(> .doc-shell),
.log-page > .container {
  background: var(--panel-1);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--ink); }

::selection { background: var(--teal); color: var(--bg-0); }

.mono { font-family: var(--mono); }
.ink { color: var(--ink); }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}


/* ---------- NAV ---------- */
nav.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-transform: uppercase;
}
.brand-mark {
  width: 22px; height: 22px;
  border: 1px solid var(--teal);
  position: relative;
  display: inline-block;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute;
  background: var(--teal);
}
.brand-mark::before { left: 50%; top: 2px; bottom: 2px; width: 1px; transform: translateX(-0.5px); }
.brand-mark::after  { top: 50%; left: 2px; right: 2px; height: 1px; transform: translateY(-0.5px); }
.brand-sub {
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.14em;
}
.nav-links {
  display: flex;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--ink-dim);
  padding: 6px 11px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.nav-links a:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(192, 216, 255, 0.02);
}
.nav-links a.current {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(192, 216, 255, 0.04);
}
/* Primary CTA in the nav bar. Compact .btn: teal outline plus the site's
   8px bracket corners at opposite diagonals. */
.nav-links a.nav-download {
  color: var(--teal);
  border-color: var(--teal);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.nav-links a.nav-download::after {
  content: "";
  position: absolute;
  top: -3px; left: -3px;
  width: 6px; height: 6px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
}
.nav-links a.nav-download::before {
  content: "";
  position: absolute;
  bottom: -3px; right: -3px;
  width: 6px; height: 6px;
  border-bottom: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
}
.nav-links a.nav-download:hover {
  color: var(--ink);
  background: var(--teal-glow);
  box-shadow: 0 0 20px var(--teal-glow);
}
.nav-links a.nav-download .nd-glyph {
  font-size: 8px;
  line-height: 1;
  opacity: 0.75;
  transform: translateY(-1px);
}
/* Secondary to Download, so the two accents do not compete. */
.nav-links a.nav-discord {
  color: var(--teal-dim);
  border-color: transparent;
}
.nav-links a.nav-discord:hover {
  color: var(--teal);
  border-color: oklch(0.80 0.12 195 / 0.4);
  background: transparent;
}
/* Drawer equivalent. */
.nav-drawer-dl {
  color: var(--teal) !important;
  border: 1px solid var(--teal) !important;
  text-align: center;
  padding: 14px !important;
  letter-spacing: 0.18em !important;
  margin-top: 10px;
}
.nav-drawer-dl:hover { background: var(--teal-glow); }
/* The build stamp yields space before the links do. Higher specificity than
   the plain .nav-status rule below, which would otherwise win on source order. */
@media (max-width: 1240px) {
  nav.topnav .nav-status { display: none; }
}
.section-meta a { color: var(--teal-dim); text-decoration: none; }
.section-meta a:hover { color: var(--teal); }
.log-more {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--teal-dim);
  padding-bottom: 2px;
}
.log-more:hover { color: var(--teal); border-bottom-color: var(--teal); }
.nav-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- SECTIONS ---------- */
section {
  position: relative;
  padding: 100px 0;
  border-bottom: 1px solid var(--line);
}
section.alt { background: var(--panel); }
section.dark { background: var(--panel-0); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  gap: 40px;
}
.section-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 44px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.section-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}


/* ---------- CHANGELOG ---------- */
.changelog {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
}
.log-entry {
  display: contents;
}
.log-entry .ver {
  font-family: var(--mono);
  color: var(--ink);
  padding: 22px 20px 22px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.log-entry .ver .vnum {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.log-entry.current .ver .vnum { color: var(--teal); }
.log-entry .ver .vdate {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-top: 4px;
  text-transform: uppercase;
}
.log-entry .ver .tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 0.22em;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  text-transform: uppercase;
}
.log-entry.current .ver .tag { color: var(--teal); border-color: var(--teal-dim); }
.log-entry .body {
  padding: 22px 0 22px 32px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  position: relative;
}
.log-entry .body::before {
  content: "";
  position: absolute;
  top: 32px; left: -4px;
  width: 7px; height: 7px;
  background: var(--ink-faint);
}
.log-entry.current .body::before { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.log-entry .title {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.log-entry ul {
  list-style: none;
  font-size: 14px;
  color: var(--ink-dim);
}
.log-entry li {
  padding: 4px 0 4px 20px;
  position: relative;
}
.log-entry li::before {
  content: "+";
  position: absolute;
  left: 0; top: 4px;
  color: var(--teal);
  font-family: var(--mono);
  font-weight: 700;
}
.log-entry li.fix::before { content: "~"; color: var(--amber); }
.log-entry li.rem::before { content: "−"; color: var(--rose); }
.log-entry li b { color: var(--ink); font-weight: 500; }
/* A release's categorised overview (d34-1): `### Category` lines in its
   player block become short sections in a grid, two or three across on a
   desktop, one on a phone. */
.log-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px 32px;
  margin-top: 4px;
}
.log-cat h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.log-entry .log-cat ul { font-size: 13.5px; }
.log-cat.known h3 { color: var(--amber); }
.log-entry .log-cat.known li::before { content: "!"; color: var(--amber); }
/* The front page's What's new is one changelog entry (build_docs.proposal_whatsnew). */
.fp-whatsnew { margin-bottom: 4px; }


/* ---------- FOOTER (every generated page: build_docs.site_footer) ---------- */
.site-foot {
  margin-top: 56px;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  background: var(--panel-1);
  text-align: center;
  font-size: 13px;
  line-height: 1.9;
}
.site-foot .sf-links a {
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
}
.site-foot .sf-links a:hover { color: var(--teal); }
.site-foot .sf-dot { color: var(--ink-ghost); margin: 0 6px; }
.site-foot .sf-ver {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  opacity: 0.75;
}


/* ---------- MOBILE NAV (hidden ≥961px) ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
}
.nav-toggle:hover { color: var(--teal); border-color: var(--teal); }
.nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 3px; }
.nav-toggle-bars i {
  display: block; width: 16px; height: 1.5px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

.nav-drawer {
  display: none;
  flex-direction: column;
  background: var(--bg-2);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px 24px;
}
.nav-drawer[data-open] { display: flex; }
.nav-drawer-hdr {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 10px;
}
.nav-drawer a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-faint);
  display: block;
  min-height: 44px;
}
.nav-drawer a:hover, .nav-drawer a:active { color: var(--teal); }
.nav-drawer-cta {
  color: var(--teal) !important;
  margin-top: 6px;
  border: 1px solid var(--line-strong) !important;
  text-align: center;
  padding: 14px !important;
  letter-spacing: 0.18em !important;
}
.nav-drawer-ft {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-top: 14px;
  text-transform: uppercase;
  text-align: right;
}


/* ---------- TABLE SCROLL WRAP ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding-bottom: 4px;
}
.table-scroll .table { min-width: 420px; }
.table-scroll .dt { min-width: 560px; }
.table-scroll .dt-ctl { min-width: 380px; }
.table-scroll::-webkit-scrollbar { height: 4px; }
.table-scroll::-webkit-scrollbar-track { background: rgba(192,216,255,0.04); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); }



/* ============================================================================
   DOC PAGES — guide.html, reference.html, changelog.html
   ==========================================================================*/

.doc-hero {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 56px 0 44px;
}
.doc-hero .doc-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 14px;
}
.doc-hero h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 18px;
}
.doc-hero .doc-lede {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-dim);
}
.doc-hero .doc-lede b { color: var(--ink); font-weight: 500; }
.doc-hero .doc-lede a { color: var(--teal-dim); text-decoration: none; border-bottom: 1px solid var(--teal-dim); }
.doc-hero .doc-lede a:hover { color: var(--teal); border-bottom-color: var(--teal); }

/* --- two-column shell: sticky contents rail + body --- */
.doc-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 80px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 78px;
  font-family: var(--mono);
  font-size: 12px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.doc-toc-hdr {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 12px;
}
.doc-toc a {
  display: block;
  padding: 5px 0;
  color: var(--ink-faint);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color .15s;
}
.doc-toc a:hover { color: var(--teal); }

.doc-body { min-width: 0; }
.doc-sec { margin-bottom: 56px; scroll-margin-top: 90px; }
.doc-sec:last-child { margin-bottom: 0; }
.doc-sec > h2 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 6px;
}
.doc-sec > h2::before {
  content: "▸ ";
  color: var(--teal-dim);
  font-size: 0.8em;
}
.doc-sec .sec-num {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  margin-bottom: 8px;
}
.doc-sec h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 30px 0 10px;
}
.doc-sec p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-dim);
  margin-bottom: 14px;
  max-width: 74ch;
}
.doc-sec p b, .doc-sec li b { color: var(--ink); font-weight: 500; }
.doc-sec p a, .doc-sec li a {
  color: var(--teal-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--teal-dim);
}
.doc-sec p a:hover, .doc-sec li a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.doc-sec ul, .doc-sec ol { margin: 0 0 16px 0; padding-left: 20px; max-width: 74ch; }
.doc-sec li { font-size: 14.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 8px; }
.doc-sec ul { list-style: none; padding-left: 18px; }
.doc-sec ul > li { position: relative; }
.doc-sec ul > li::before {
  content: "—";
  position: absolute;
  left: -18px;
  color: var(--ink-ghost);
}
.doc-sec ol > li::marker { color: var(--teal-dim); font-family: var(--mono); font-size: 12px; }

/* --- callout --- */
.note {
  border-left: 2px solid var(--teal-dim);
  background: var(--panel);
  padding: 14px 18px;
  margin: 18px 0;
  max-width: 74ch;
}
.note.warn { border-left-color: var(--amber); }
.note .note-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 6px;
}
.note.warn .note-k { color: var(--amber); }
.note p { margin-bottom: 0; font-size: 14px; }
.note p + p { margin-top: 10px; }

/* --- data tables --- */
.dt {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12.5px;
  margin: 6px 0 18px;
}
.dt th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-ghost);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.dt td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink-dim);
  vertical-align: top;
}
.dt tbody tr:hover td { background: rgba(192, 216, 255, 0.02); }
.dt td b { color: var(--ink); font-weight: 700; }
.dt td .mono { color: var(--teal); }
.dt-note { color: var(--ink-ghost); font-size: 11px; }
.dt-foot { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); margin-top: -6px; }
.dt-roles td:last-child, .dt td:last-child { font-family: var(--sans); font-size: 13.5px; line-height: 1.6; }
.dt-roles td i, .dt td i { color: var(--ink-faint); font-style: normal; }

/* --- controls --- */
.ctl-group { margin-bottom: 34px; }
.ctl-h {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  scroll-margin-top: 90px;
}
.ctl-intro { font-size: 14px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 12px; max-width: 74ch; }
.dt-ctl td { border-bottom: 1px solid var(--line-faint); }
.ctl-keys { width: 34%; white-space: normal; padding-right: 20px !important; }
.ctl-act { font-family: var(--sans); font-size: 13.5px; }
.ctl-act b { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--ink); margin-bottom: 3px; }
.ctl-desc { display: block; color: var(--ink-faint); line-height: 1.6; }
/* d32-2: a key reads [K], as in the game (KeyFmt.gd): the key in the warm
   accent of the game's build grid keys, the brackets dimmer. */
kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.2;
  color: #ffdb73;
  white-space: nowrap;
  margin: 1px 0;
}
kbd::before { content: "["; color: var(--ink-faint); }
kbd::after { content: "]"; color: var(--ink-faint); }
.kplus { color: var(--ink-ghost); font-family: var(--mono); font-size: 11px; margin: 0 2px; }

/* --- lists with a bit of ceremony --- */
.victory-list, .ai-list, .triangle-list { max-width: 74ch; }
.triangle-list { list-style: none; padding-left: 0; }
.triangle-list li { padding-left: 18px; position: relative; }
.triangle-list li::before { content: "▲"; position: absolute; left: 0; color: var(--teal-dim); font-size: 10px; top: 5px; }

/* --- step cards for the first-match walkthrough --- */
.steps { counter-reset: step; margin: 18px 0 24px; }
.step {
  counter-increment: step;
  border-left: 1px solid var(--line-strong);
  padding: 0 0 22px 22px;
  position: relative;
}
.step:last-child { padding-bottom: 0; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -13px;
  top: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  background: var(--bg-1);
  border: 1px solid var(--teal-dim);
}
.step h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.step p { margin-bottom: 0; }

/* --- changelog page --- */
.log-page { padding: 40px 0 80px; }
.log-page .changelog { max-width: none; }

@media (max-width: 1000px) {
  .doc-shell { grid-template-columns: 1fr; gap: 0; }
  .doc-toc {
    position: static;
    border-left: none;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
    margin-bottom: 32px;
    columns: 2;
  }
}
@media (max-width: 640px) {
  .doc-hero { padding: 36px 0 30px; }
  .doc-shell { padding: 32px 0 56px; }
  .doc-sec { margin-bottom: 42px; }
  .doc-sec > h2 { font-size: 21px; }
  .doc-toc { columns: 1; }
  .ctl-keys { width: 42%; }
  .dt { font-size: 11.5px; }
}


/* ============================================================================
   RESPONSIVE — the shared-component half of index.html's media queries.
   These were missed in the first extraction, which left the doc pages with no
   mobile nav collapse at all: the links stayed visible and the MENU toggle
   never appeared.
   ==========================================================================*/

@media (max-width: 960px) {
  .nav-links, .nav-status { display: none; }
  .nav-toggle { display: inline-flex; }
  .container, .nav-inner { padding: 0 24px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-title { font-size: 32px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; line-height: 1.5; }
  .container, .nav-inner { padding: 0 18px; }
  .nav-inner { height: 58px; }
  .brand { font-size: 14px; letter-spacing: 0.14em; }
  .brand-sub { display: none; }
  .nav-toggle { padding: 8px 12px; font-size: 10px; }
  .nav-toggle-label { display: none; }
  /* .log-entry is display: contents, so the stack is set on .changelog
     (d34-1: the version column above its notes on a phone). */
  .changelog { grid-template-columns: 1fr; }
  .log-entry .ver { padding: 18px 0 6px; }
  .log-entry .body { padding: 6px 0 22px; border-top: none; border-left: none; }
  .log-entry .body::before { display: none; }
  .log-cats { grid-template-columns: 1fr; }
}

/* ---------- SHIP CARDS (reference.html "The fleet", GEN:ships-cards) ----------
 * From the old front page (d3-5), which was dropped. */
.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-right: none;
  border-bottom: none;
}
.ship-card {
  padding: 22px 22px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: relative;
  transition: background .18s;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.ship-card:hover { background: var(--bg-3); }

.ship-card .corner {
  position: absolute;
  width: 10px; height: 10px;
}
.ship-card .corner.tl { top: 6px; left: 6px; border-top: 1px solid var(--teal-dim); border-left: 1px solid var(--teal-dim); }
.ship-card .corner.br { bottom: 6px; right: 6px; border-bottom: 1px solid var(--teal-dim); border-right: 1px solid var(--teal-dim); }

.ship-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.ship-hdr .class { color: var(--teal); }
.ship-art {
  background:
    radial-gradient(ellipse at center, rgba(192,216,255,0.06), transparent 70%),
    linear-gradient(to right, rgba(192,216,255,0.04) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(to bottom, rgba(192,216,255,0.04) 1px, transparent 1px) 0 0 / 16px 16px;
  border: 1px solid var(--line);
  aspect-ratio: 1;
  max-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
  filter: drop-shadow(0 0 10px oklch(0.7 0.1 235 / 0.15));
}
.ship-art img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: brightness(1.35) contrast(1.1);
}
.ship-art .reticle {
  position: absolute;
  inset: 4px;
  pointer-events: none;
}
.ship-art .reticle::before, .ship-art .reticle::after {
  content: ""; position: absolute;
  background: var(--line-strong);
}
.ship-art .reticle::before { top: 50%; left: 0; right: 0; height: 1px; }
.ship-art .reticle::after { left: 50%; top: 0; bottom: 0; width: 1px; }
.ship-art .ship-glyph {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--teal-dim);
  background: rgba(8, 12, 20, 0.6);
  filter: brightness(1.7) contrast(1.05);
  object-fit: contain;
  pointer-events: none;
}

.ship-name {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.ship-role {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.ship-role .dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 8px;
  vertical-align: 1px;
}
.dot.teal { background: var(--teal); box-shadow: 0 0 6px var(--teal); }
.dot.violet { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot.rose { background: var(--rose); box-shadow: 0 0 6px var(--rose); }
.dot.ghost { background: var(--ink-faint); }

.ship-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.ship-stats .k { color: var(--ink-faint); letter-spacing: 0.1em; font-size: 10px; text-transform: uppercase; }
.ship-stats .v { color: var(--ink); text-align: right; }

.triangle-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1px solid currentColor;
  opacity: 0.9;
  white-space: nowrap;
}
.ship-hdr .triangle-tag { margin-left: auto; }
.triangle-tag.teal { color: var(--teal); }
.triangle-tag.violet { color: var(--violet); }
.triangle-tag.amber { color: var(--amber); }
.triangle-tag.rose { color: var(--rose); }
.triangle-tag.ghost { color: var(--ink-faint); }
@media (max-width: 640px) {
  .ship-grid { grid-template-columns: 1fr; }
  .ship-card { min-height: auto; padding: 20px; }
  .ship-card .ship-art { height: 110px; }
}


/* ============================================================================
   FRONT PAGE — index.html (tools/site_proposal/, d3-6): the hero video, the
   feature cards, the match strip, the download cards. The nav, the section
   heads (.section-index / .section-title), .note and the footer are the
   shared rules above; the hero type and .btn are the old front page's.
   ==========================================================================*/

/* --- hero: the looping video, the words over it --- */
.hero {
  position: relative;
  height: 78vh; min-height: 520px; max-height: 1080px;
  overflow: hidden;
  display: flex; align-items: flex-end;
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
}
.hero-video, .hero-still {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-still { display: none; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(7, 10, 17, 0.95) 0%, rgba(7, 10, 17, 0.72) 40%, rgba(7, 10, 17, 0.35) 62%, rgba(7, 10, 17, 0) 85%);
}
.hero-copy {
  position: relative;
  width: 100%;
  padding-bottom: 56px;
}
h1.hero-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.92;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 0 0 30px oklch(0.7 0.1 235 / 0.3), 0 2px 18px rgba(0, 0, 0, 0.6);
}
.hero-line {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 600px;
  margin-bottom: 30px;
  text-wrap: balance;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-version {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--amber);
  border: 1px solid var(--amber);
  padding: 4px 10px;
}
.hero-note {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
}
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero-still { display: block; }
}

/* --- the bracket-cornered button --- */
.btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid var(--teal);
  background: rgba(8, 12, 20, 0.55);
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 14px;
  position: relative;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn::after {
  content: "";
  position: absolute;
  top: -3px; left: -3px;
  width: 8px; height: 8px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
}
.btn::before {
  content: "";
  position: absolute;
  bottom: -3px; right: -3px;
  width: 8px; height: 8px;
  border-bottom: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
}
.btn:hover {
  background: var(--teal-glow);
  box-shadow: 0 0 24px var(--teal-glow);
  color: var(--ink);
}
.btn .arrow { font-size: 14px; }

/* --- sections ---
 * --front-veil: the front page's text column over the starfield. 0 = the
 * stars run behind the section heads and lines (the proposal's look);
 * 0.85 = the doc pages' veiled column (batch d3-site3, decision). */
:root { --front-veil: 0; }
.fp-sec > .container { background: rgba(8, 12, 20, var(--front-veil)); }
section.fp-sec { padding: 88px 0; }
section.fp-sec:last-child { border-bottom: none; }
.fp-sec .section-head { margin-bottom: 40px; }
.section-title .ver {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-left: 10px;
  vertical-align: middle;
}
.fp-intro {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 74ch;
  margin-bottom: 26px;
}
.what-lines { list-style: none; display: grid; gap: 14px; max-width: 74ch; }
.what-lines li {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--teal-dim);
}

/* --- cards: the site's panel with corner brackets --- */
.fp-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
}
.fp-card::before, .fp-card::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  pointer-events: none;
}
.fp-card::before { top: -3px; left: -3px; border-top: 1px solid var(--teal-dim); border-left: 1px solid var(--teal-dim); }
.fp-card::after { bottom: -3px; right: -3px; border-bottom: 1px solid var(--teal-dim); border-right: 1px solid var(--teal-dim); }
.fp-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); }
.fp-card h3 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 18px 20px 8px;
}
.fp-card p { margin: 0 20px 20px; font-size: 14.5px; line-height: 1.7; color: var(--ink-dim); }
.fp-cards { display: grid; gap: 24px; }

/* --- the match in five stills --- */
.fp-strip { list-style: none; display: grid; gap: 16px; counter-reset: step; }
.fp-strip li {
  counter-increment: step;
  display: grid; grid-template-columns: 44% 1fr; gap: 14px; align-items: center;
}
.fp-strip img { aspect-ratio: 4 / 3; border-bottom: none; }
.fp-strip p { margin: 0; padding: 10px 14px 10px 0; font-size: 14px; line-height: 1.6; }
.fp-strip p::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--teal);
  margin-bottom: 4px;
}
.fp-strip p b { color: var(--ink); font-weight: 500; }

/* --- download cards --- */
.fp-dl { display: grid; gap: 16px; }
.fp-dl a {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.fp-dl a::before, .fp-dl a::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
}
.fp-dl a::before { top: -3px; left: -3px; border-top: 1px solid var(--teal); border-left: 1px solid var(--teal); }
.fp-dl a::after { bottom: -3px; right: -3px; border-bottom: 1px solid var(--teal); border-right: 1px solid var(--teal); }
.fp-dl a:hover { border-color: var(--teal); box-shadow: 0 0 20px var(--teal-glow); }
.fp-dl .os {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.fp-dl .arrow { grid-row: span 2; color: var(--teal); font-size: 20px; }
.fp-dl .meta { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--ink-faint); }
.fp-help {
  max-width: none;
  margin: 26px 0 0;
  display: grid;
  gap: 12px;
}
.fp-help p { max-width: 74ch; color: var(--ink-dim); }
.fp-help .bugs a {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- devlog --- */
.fp-devlog video, .fp-devlog .yt {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.fp-devlogs { display: grid; gap: 32px; }
.fp-devlog h3 { margin: 16px 20px 14px; }
.fp-chapters {
  list-style: none;
  margin: 0;
  padding: 16px 20px 20px;
  column-gap: 32px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.fp-chapters li { break-inside: avoid; padding: 2px 0; }
.fp-chapters .t {
  display: inline-block;
  min-width: 3.2em;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--teal-dim);
}
@media (min-width: 560px) {
  .fp-chapters { columns: 2; }
}
/* The front page's line to devlog.html (d19-3). */
.fp-more { margin: 22px 0 0; }
.fp-more a { color: var(--teal-dim); text-decoration: none; border-bottom: 1px solid var(--teal-dim); }
.fp-more a:hover { color: var(--teal); border-bottom-color: var(--teal); }

@media (min-width: 720px) {
  .fp-cards { grid-template-columns: 1fr 1fr; }
  .fp-dl { grid-template-columns: repeat(3, 1fr); }
  .fp-help { grid-template-columns: 1fr auto; align-items: end; }
}
@media (min-width: 1100px) {
  .hero { height: min(88vh, 56.25vw); }
  .fp-strip { grid-template-columns: repeat(5, 1fr); }
  .fp-strip li { grid-template-columns: 1fr; align-items: start; align-content: start; gap: 0; }
  .fp-strip img { border-bottom: 1px solid var(--line); }
  .fp-strip p { padding: 14px 16px 18px; }
}
@media (max-width: 640px) {
  .hero-copy { padding-bottom: 30px; }
  h1.hero-title { margin-bottom: 14px; }
  .hero-line { font-size: 16px; margin-bottom: 22px; }
  section.fp-sec { padding: 56px 0; }
  .fp-sec .section-head { margin-bottom: 26px; }
  .what-lines li { font-size: 16px; }
}
