/* ============================================================
 * NightScribe: the website
 *
 * GENERATED by website/tools/build_site.py: edit tools/site.css, never this
 * file. The palette comes from nightscribe/gui/theme.py (the application's
 * single source of visual identity, ADR-026), so the site and the app wear
 * the same colours by construction.
 * ============================================================ */

:root {
  --bg: #0f121c;
  --base: #12141f;
  --panel: #171a26;
  --line: #232736;
  --edge: #3a4156;
  --hover: #212739;
  --dim-fill: #141824;
  --sel: #2f4d80;
  --text: #e8eaf2;
  --dim: #8a90a6;
  --accent: #6ab0ff;
  --warn: #f76808;
  --good: #46a758;
  --ok: #4484ef;
  /* the label colour on a bright surface (the app's C_CHIP_TEXT_DARK) */
  --chip-text: #11141d;
  /* the reading page, the way the app renders a document */
  --paper: #ffffff;
  --paper-text: #1b1f2a;
  --paper-dim: #5b6478;
  --paper-line: #d9dfec;
  --paper-link: #0a58ca;
  --kind-sn: #e5484d;
  --kind-alert: #f76808;
  --kind-variable: #65cf30;
  --kind-comet: #46a758;
  --kind-pccp: #39c5cf;
  --kind-neo: #4484ef;
  --kind-transit: #a06ee0;
  --kind-hads: #e0549e;
  --radius: 12px;
  --max: 1120px;
  --bar-h: 58px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------------------------------------------------------- the top bar */

.bar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.bar-in {
  max-width: var(--max); margin: 0 auto; min-height: var(--bar-h);
  padding: 0 20px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand:hover { text-decoration: none; }
.wordmark { font-weight: 800; letter-spacing: 2.5px; font-size: 15px; }
.wordmark b, .hero-title b { color: var(--accent); }
/* The navigation NEVER scrolls: the entries are the curated main sections,
   and if a screen is too narrow for them the menu wraps instead (a scrollbar
   in the header is what the redesign removed). */
.bar-nav {
  display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1;
  align-content: center;
}
.bar-nav a {
  color: var(--dim); font-size: 13px; white-space: nowrap;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.bar-nav a:hover, .bar-nav a.on { color: var(--text); text-decoration: none; }
.bar-nav a.on { border-bottom-color: var(--accent); }
.bar-end { display: flex; align-items: center; gap: 12px; }
.bar-end .ghost, .bar-end .lang {
  font-size: 12.5px; color: var(--dim); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 11px;
}
.bar-end .ghost:hover, .bar-end .lang:hover {
  color: var(--text); border-color: var(--edge); text-decoration: none;
}
/* The phone's menu: hidden on a desktop, where the links row is right there.
   It is a native <details>, so it works with no JavaScript at all. */
.bar-menu { display: none; }
.bar-menu > summary {
  list-style: none; cursor: pointer; color: var(--text); font-size: 17px;
  line-height: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px 6px;
}
.bar-menu > summary::-webkit-details-marker { display: none; }
.bar-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.bar-menu > nav {
  position: absolute; right: 20px; top: calc(var(--bar-h) - 4px); z-index: 40;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  min-width: 230px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.bar-menu > nav a {
  color: var(--text); font-size: 14px; padding: 8px 10px; border-radius: 8px;
}
.bar-menu > nav a:hover { background: var(--base); text-decoration: none; }

/* -------------------------------------------------------------- the hero */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-sky {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(4, 6, 13, 0.25) 0%, rgba(4, 6, 13, 0.55) 55%,
    rgba(15, 18, 28, 0.96) 100%);
}
.hero-in {
  position: relative; z-index: 1; max-width: var(--max); margin: 0 auto;
  padding: 78px 20px 64px;
}
.hero-kicker {
  margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
}
.hero-title {
  margin: 0; font-size: clamp(38px, 7vw, 68px); font-weight: 800;
  letter-spacing: 6px; line-height: 1;
}
.hero-tag {
  margin: 16px 0 0; font-size: clamp(18px, 2.4vw, 24px); color: #dfe6f5;
  max-width: 34ch;
}
.hero-what { margin: 12px 0 0; color: #b9c2d6; max-width: 62ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.hero-glance {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0;
}
.glance {
  font-size: 12.5px; color: #cfd9ee; background: rgba(9, 13, 24, 0.6);
  border: 1px solid rgba(90, 110, 150, 0.35); border-radius: 999px;
  padding: 4px 12px;
}

.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  font-weight: 600; font-size: 15px; border: 1px solid var(--edge);
  background: var(--panel); color: var(--text);
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary {
  background: linear-gradient(180deg, #2f6fd0, #2559a8);
  border-color: #4d86e0; color: #fff;
}
.btn.primary:hover { background: #3579dd; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: rgba(106, 176, 255, 0.12); }

/* ------------------------------------------------------------- sections */

.block { max-width: var(--max); margin: 0 auto; padding: 54px 20px; }
.block + .block { border-top: 1px solid var(--line); }
.block h2 {
  margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.2px;
}
.block .lead { color: var(--dim); margin: 0 0 22px; max-width: 70ch; }
.block > p, .block li { color: #ccd3e4; }
.block h3 { margin: 26px 0 6px; font-size: 18px; }
.block ul, .block ol { padding-left: 22px; }
.block li { margin: 4px 0; }
.block a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.block a:hover { text-decoration: none; border-bottom-color: var(--accent); }
.block code {
  background: var(--base); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: 0.92em;
  /* a long identifier or URL breaks instead of pushing the page sideways */
  overflow-wrap: anywhere;
}
.block strong { color: var(--text); }

/* the four missions and the project loop */
/* The grids never force a horizontal scroll: `min(100%, X)` lets a column be
   narrower than X when the screen is (the old plain `minmax(X, 1fr)` overflowed
   on a 320 px phone, where only 280 are left). */
.missions {
  display: grid; gap: 14px; margin: 22px 0 26px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.mission {
  background: var(--base); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.mission h3 { margin: 0 0 6px; font-size: 16px; color: var(--accent); }
.mission p { margin: 0; color: #ccd3e4; font-size: 14.5px; }
.loop {
  display: flex; flex-wrap: wrap; gap: 8px 26px; list-style: none;
  padding: 0; margin: 0; counter-reset: step;
}
.loop li { display: flex; align-items: center; gap: 9px; color: var(--dim); }
.loop li::before {
  counter-increment: step; content: counter(step);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--edge); color: var(--text);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.loop li + li::after { content: "→"; color: var(--edge); margin-left: 18px; }

/* the target kinds: the app's own chips and colours */
.kinds {
  display: grid; gap: 14px; margin-top: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}
.kind {
  background: var(--base); border: 1px solid var(--line);
  border-top: 3px solid var(--kind); border-radius: var(--radius);
  padding: 16px 18px 14px; display: flex; flex-direction: column;
  gap: 9px;
}
.kind p { margin: 0; color: #ccd3e4; font-size: 14.5px; }
.kind .kind-src { color: var(--dim); font-size: 12.5px; margin-top: auto; }
.kind .more { font-size: 13px; font-weight: 600; }
.chip {
  display: inline-block; background: var(--kind); color: var(--chip-text);
  font-weight: 700; font-size: 12px; border-radius: 999px;
  padding: 3px 11px; letter-spacing: 0.2px;
}

/* the long chapter, folded */
.detail {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--base); margin: 10px 0; overflow: hidden;
}
.detail summary {
  cursor: pointer; padding: 13px 18px; font-weight: 600;
  color: var(--text); list-style: none;
}
.detail summary::-webkit-details-marker { display: none; }
.detail summary::before {
  content: "＋"; color: var(--accent); margin-right: 10px; font-weight: 700;
}
.detail[open] summary::before { content: "－"; }
.detail[open] summary { border-bottom: 1px solid var(--line); }
.detail-body { padding: 4px 18px 14px; }
.detail-body h4 { margin: 14px 0 4px; font-size: 15px; }

/* the guide's chapters, as cards */
.chapters {
  display: grid; gap: 10px; margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.chapter {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--base); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; color: var(--text);
}
.chapter:hover { border-color: var(--accent); text-decoration: none; }
.chapter-n { color: var(--accent); font-weight: 700; font-size: 13px; }
.chapter-t { font-size: 14.5px; }

/* --------------------------------------------------- the screenshots */

/* Real captures of the application (ADR-070): the landing shows them in a
   grid under "The app", and a guide chapter shows its own right under the
   title. The frame is the same in both places, lighter on the paper. */
.shots {
  display: grid; gap: 18px; margin-top: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.shot { margin: 0; }
.shot .zoom { display: block; cursor: zoom-in; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}
.shot figcaption { color: var(--dim); font-size: 13px; margin-top: 9px; }
.paper .shot { margin: 20px 0 26px; }
.paper .shot img {
  border-color: var(--paper-line);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
}
.paper .shot figcaption { color: var(--paper-dim); }

/* The larger view the script builds (site.js): the same image over a dark
   backdrop, with its caption. Without JavaScript the link simply opens the
   file, which is why the image sits inside an <a>. */
#lightbox {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(6, 8, 14, 0.94); padding: 4vh 3vw;
  flex-direction: column; align-items: center; justify-content: center;
  cursor: zoom-out;
}
#lightbox.on { display: flex; }
#lightbox img {
  max-width: 100%; max-height: 80vh; width: auto; height: auto;
  border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
#lightbox p.cap {
  color: #dfe6f5; font-size: 14px; line-height: 1.5; margin: 14px 0 0;
  max-width: 92ch; text-align: center;
}
#lightbox p.hint {
  color: var(--dim); font-size: 12.5px; margin: 8px 0 0; text-align: center;
}
/* A button, not a glyph lost in a corner: closing a full-screen image has to
   be obvious, and on a phone there is no Escape key. */
#lightbox .close {
  position: absolute; top: 14px; right: 18px; width: 42px; height: 42px;
  display: grid; place-items: center; font-size: 19px; line-height: 1;
  color: var(--text); background: rgba(23, 26, 38, 0.92);
  border: 1px solid var(--edge); border-radius: 50%; cursor: pointer;
}
#lightbox .close:hover, #lightbox .close:focus-visible {
  background: var(--hover); border-color: var(--accent); color: #ffffff;
  outline: none;
}

/* ---------------------------------------------------------------- guide */

.doc {
  max-width: 1240px; margin: 0 auto; padding: 26px 20px 60px;
  display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 26px;
  align-items: start;
}
.side { position: sticky; top: calc(var(--bar-h) + 16px); min-width: 0; }
.doc-main { min-width: 0; }
.side-fold > summary { list-style: none; cursor: pointer; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-title {
  margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--dim);
}
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  display: flex; gap: 9px; padding: 7px 10px; border-radius: 8px;
  color: #ccd3e4; font-size: 14px; line-height: 1.35;
}
.toc-link span { color: var(--dim); font-variant-numeric: tabular-nums; }
.toc-link:hover { background: var(--base); text-decoration: none; }
.toc-link.on { background: var(--sel); color: #fff; }
.toc-link.on span { color: #dce6ff; }
.side-back { margin: 14px 0 0; padding: 0 10px; font-size: 13px; }
.adv-list { margin: 0 0 26px; padding-left: 18px; }
.adv-list li { margin: 6px 0; }

.paper {
  background: var(--paper); color: var(--paper-text);
  border-radius: var(--radius); padding: 34px 42px 42px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}
.paper h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.2; }
.paper h2 {
  margin: 34px 0 8px; font-size: 22px; padding-bottom: 6px;
  border-bottom: 1px solid var(--paper-line);
}
.paper h3 { margin: 26px 0 6px; font-size: 18px; }
.paper h4 { margin: 20px 0 4px; font-size: 16px; }
.paper p, .paper li { color: #2b3244; }
.paper strong { color: #10141d; }
.paper a { color: var(--paper-link); }
.paper code {
  background: #eef1f8; border: 1px solid var(--paper-line); border-radius: 5px;
  padding: 1px 6px; font-size: 0.92em; overflow-wrap: anywhere;
}
/* The code block scrolls on its own, wherever it is: the landing used to have
   no rule for it (only the paper did) and its long lines dragged the whole
   document to 754 px on a phone. */
.code {
  background: #12141f; color: #dfe4f0; border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.55;
}
.code code { background: none; border: 0; padding: 0; color: inherit; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.paper table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.paper th, .paper td {
  border: 1px solid var(--paper-line); padding: 7px 11px;
  vertical-align: top;
}
.paper th { background: #eef1f8; font-weight: 700; }
.paper blockquote {
  margin: 18px 0; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--paper-line); color: var(--paper-dim);
}
.paper blockquote.why {
  background: #f2f7ff; border-left-color: var(--accent);
  border-radius: 0 10px 10px 0; padding: 13px 18px; color: #33405c;
}
.paper blockquote.why strong { color: #14315e; }
.paper hr { border: 0; border-top: 1px solid var(--paper-line); margin: 30px 0; }

.pn { display: flex; gap: 12px; margin: 20px 0 0; }
.pn a {
  flex: 1; background: var(--base); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; color: var(--text); font-size: 14px;
}
.pn a:hover { border-color: var(--accent); text-decoration: none; }
.pn a span {
  display: block; color: var(--dim); font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 2px;
}
.pn .pn-next { text-align: right; }

/* --------------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--line); padding: 26px 20px 40px;
  text-align: center; color: var(--dim); font-size: 13px;
}
.foot p { margin: 4px 0; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  /* `minmax(0, 1fr)`, not `1fr`: a plain 1fr cannot shrink below its content,
     and the contents' links are nowrap, so the whole guide was dragged to
     1764 px wide on a phone (measured 2026-10-08). */
  .doc { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .toc {
    flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 6px;
  }
  .toc-link { white-space: nowrap; background: var(--base); }
  .paper { padding: 24px 20px 30px; }
  .bar-nav { display: none; }
  .bar-menu { display: block; position: relative; }
  /* the fold says it can be opened, and the reader can see it is closed */
  .side-fold > summary::after { content: " ▸"; color: var(--accent); }
  .side-fold[open] > summary::after { content: " ▾"; }
}

@media (max-width: 420px) {
  /* the mark, the guide's link and the language did not fit together: the
     name and the guide's own pill step aside (the brand goes home, and the
     guide's pages have the contents one line below) */
  .wordmark { display: none; }
  .bar-end .guide { display: none; }
  /* the hero's wordmark was cut at 320 (38 px with 6 px of letter spacing
     needs ~350): it comes down instead of overflowing its own box */
  .hero-title { font-size: 30px; letter-spacing: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
