/* ---------------------------------------------------------------------------
   Shared stylesheet for the standalone pages: /privacy /terms /docs /security /404.
   These render without JavaScript and without the index.html runtime, so they
   carry their own styling rather than the site's.

   Why this file exists. Phase 6 replaced two failing body colours site-wide;
   the replacement never reached the legal pages, because each carried its own
   copy of the stylesheet, and the commit message said otherwise. Phase 7 found
   it. 404.html shows the failure fully realised — it was written in Phase 1 and
   never swept again, so it kept the old palette, an enumerated focus-ring
   selector and no reduced-motion guard. At three copies that was a nuisance; at
   five it is a recurring bug. One file means the next colour fix is structurally
   correct instead of correct-if-you-remember.

   Layout, in two layers:
     BASE      tokens, reset, body, links, focus, brand, reduced motion — every page
     DOCUMENT  scoped under .wrap — the long-form pages only, so /404 loads the
               same file and simply never matches them

   Cache policy: served `public, max-age=3600, must-revalidate` via vercel.json,
   the same treatment /support.js gets. NOT under /assets/, which is immutable for
   a year — a colour fix frozen in browsers for a year is the exact failure this
   file exists to prevent. For an urgent change, bump the <link> to ?v=2.
--------------------------------------------------------------------------- */

/* =========================== BASE — every page =========================== */

:root {
  --bg:    #050a10;   /* page ground; every ratio below is measured against it */
  --cyan:  #46d6e6;   /* 11.4:1  accent, links                                */
  --ink:   #eaf6f8;   /* 18.0:1  headings, emphasis                           */
  --body:  #9bc4cc;   /* 10.6:1  body copy                                    */
  --muted: #88aab2;   /*  8.0:1  secondary copy                               */
  --dim:   #7f9ba3;   /*  6.7:1  metadata                                     */
  --soft:  #cdeef3;   /* 16.2:1  ghost-button labels                          */
  /* The two colours Phase 7 corrected. Named here so the next sweep can find
     them — as raw hex in five files they were missed once already. */
  --foot:      #63818a;   /* 4.8:1 — the thinnest margin on the site. AA for
                             normal text needs 4.5:1, so this has 0.26 to give.
                             Do not darken it, and do not move it onto a
                             lighter panel without re-measuring. */
  --foot-link: #6f8d95;   /* 5.7:1 */
}

* { box-sizing: border-box; }

/* No font-size or line-height here: /404 centres a splash and sizes each element
   itself, while the document pages set 15px/1.75 on .wrap. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-underline-offset: 3px; }

/* Every link on every page, present and future. 404.html used to enumerate
   (.btn, .brand, .foot a), so any link added outside those three classes got no
   focus ring at all — reopening A6 silently. */
a:focus-visible,
button:focus-visible,
.brand:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.brand {
  display: flex; align-items: center; gap: 3px;
  font-family: 'Chakra Petch', sans-serif; font-weight: 700;
  font-size: 18px; letter-spacing: 2px;
  color: var(--ink); text-decoration: none;
}
.brand .sl { color: var(--cyan); }

/* index.html carries four of these guards; the standalone pages carried none. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn:hover, .btn-primary:hover { transform: none !important; }
}

/* ================= DOCUMENT — the long-form pages only ================== */
/* Scoped under .wrap so /404 never matches any of it. */

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 38px clamp(22px, 5vw, 40px) 80px;
  font-size: 15px;
  line-height: 1.75;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 26px; border-bottom: 1px solid rgba(70,214,230,0.12);
}
.back { font-size: 12px; letter-spacing: 1.4px; color: var(--dim); text-decoration: none; }
.back:hover { color: var(--ink); }

.eyebrow {
  margin-top: 44px;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--body);
}
.eyebrow b { color: var(--cyan); font-weight: 400; }

.wrap h1 {
  margin: 16px 0 0;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.1;
  font-weight: 600; letter-spacing: -1.2px;
}
.updated { margin-top: 14px; font-size: 12.5px; color: var(--dim); }
.lede { margin-top: 26px; font-size: 16px; line-height: 1.7; color: var(--muted); }

.wrap h2 {
  margin: 46px 0 0;
  font-size: 19px; font-weight: 600; letter-spacing: -0.3px;
  color: var(--ink);
}
.wrap h2 .n { color: var(--cyan); margin-right: 10px; font-weight: 400; }

.wrap h3 {
  margin: 30px 0 0;
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px;
  color: var(--ink);
}

.wrap p  { margin: 14px 0 0; color: var(--body); }
.wrap ul { margin: 14px 0 0; padding-left: 20px; color: var(--body); }
.wrap li { margin: 8px 0; }
.wrap li b, .wrap p b { color: var(--ink); font-weight: 600; }

/* Pull-out note. Dashed, tinted: composited, --muted on it is 7.7:1. */
.box {
  margin-top: 22px;
  border: 1px dashed rgba(70,214,230,0.25);
  background: rgba(70,214,230,0.03);
  padding: 18px 20px;
  font-size: 14px; line-height: 1.7; color: var(--muted);
}
.box b { color: var(--cyan); font-weight: 600; }

/* Solid-left-rule variant, for "this is not true yet" callouts that should read
   as a correction rather than an aside. */
.note {
  margin-top: 22px;
  border-left: 2px solid rgba(70,214,230,0.45);
  background: rgba(70,214,230,0.03);
  padding: 16px 20px;
  font-size: 14px; line-height: 1.7; color: var(--muted);
}
.note b { color: var(--ink); font-weight: 600; }

/* Term/definition list, for the concept pages. */
.defs { margin-top: 22px; }
.defs dt {
  margin-top: 18px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.3px; color: var(--cyan);
}
.defs dd { margin: 6px 0 0; color: var(--body); }

/* Inline code and prompt examples. The tint composites to rgb(7,16,22); --ink on
   it measures 17.3:1 and --body 10.2:1. */
code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.92em;
  background: rgba(70,214,230,0.05);
  border: 1px solid rgba(70,214,230,0.14);
  padding: 1px 6px;
  color: var(--soft);
}
.prompt {
  margin-top: 14px;
  background: rgba(70,214,230,0.04);
  border: 1px solid rgba(70,214,230,0.16);
  border-left: 2px solid rgba(70,214,230,0.45);
  padding: 13px 16px;
  font-size: 13.5px; line-height: 1.7; color: var(--soft);
  overflow-x: auto;
}
.prompt .c { color: var(--dim); }   /* the "> " gutter and any annotation */

.foot {
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid rgba(70,214,230,0.12);
  display: flex; flex-wrap: wrap; gap: 18px;
  font-size: 12px; letter-spacing: 1px;
  color: var(--foot);
}
.foot a { color: var(--foot-link); text-decoration: none; }
.foot a:hover { color: var(--body); }
