/* ==========================================================================
   Model Kit · documentation
   Tokens come from /design/tokens.css. Page styles only; never a token here.

   WHY THIS IS A FILE AND NOT A BLOCK IN EVERY PAGE. The marketing page and
   the two legal pages each carry their own copy of the base styles, with a
   comment saying the copy is deliberate so the pages read as one product.
   That holds for three pages. Documentation grows: this section starts at six
   and the seventh should cost a content file and nothing else. So the shared
   dialect lives here once, and a new page links it.

   It is the same dialect, not a new one: the base block below is the legal
   pages' base block, and every token is the product's own.
   ========================================================================== */

/* ---------- base, shared with the site and the legal pages ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* the cutting mat: an 18px grid over styrene paper */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p, ul, ol, table { margin: 0; }
a { color: var(--color-blue); text-underline-offset: 3px; }
a:hover { color: color-mix(in srgb, var(--color-blue) 75%, var(--color-text)); }
img, svg { max-width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
code { font-family: var(--font-mono); font-size: 0.88em; }

.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-accent);
}
.lead { font-size: 1.06rem; color: var(--color-neutral-300); }
.small { font-size: 0.85rem; color: var(--color-neutral-400); }
.muted { color: var(--color-neutral-400); }
.mono { font-family: var(--font-mono); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-divider);
}
.site-head .bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px clamp(16px, 4vw, 28px);
  max-width: 1100px; margin: 0 auto;
}
.wordmark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--color-text); }
.wordmark .g { width: 26px; height: 26px; display: block; }
.wordmark .name { font-family: var(--font-brand); font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.wordmark .addr { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-neutral-500); margin-left: 4px; }
.head-spacer { flex: 1; }
.theme-toggle {
  border: 1px solid var(--color-divider); background: transparent; color: var(--color-neutral-400);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  border-radius: 999px; padding: 5px 11px; cursor: pointer;
}
.theme-toggle:hover { color: var(--color-text); }
.head-cta {
  display: inline-block; text-decoration: none;
  background: transparent; color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600;
}
.head-cta:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); color: var(--color-accent); }

/* ---------- the two-column shell ----------
   THE CONTENTS SIT BESIDE THE PAGE ON A DESKTOP AND ABOVE IT ON A PHONE,
   which is the ordinary shape of documentation and is what makes a set of
   pages feel like one manual rather than six leaflets. It is grid rather
   than flex so the aside can be ordered first on a narrow screen without
   the page jumping. */
.shell {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 28px) clamp(56px, 9vw, 96px);
  display: grid; gap: clamp(24px, 4vw, 44px);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .shell { grid-template-columns: 216px minmax(0, 1fr); align-items: start; }
  .contents { position: sticky; top: 68px; }
}

/* ---------- the contents ---------- */
.contents h2 {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-neutral-500);
  margin-bottom: 10px;
}
.contents ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.contents a {
  display: block; padding: 6px 10px; border-radius: var(--radius-md);
  text-decoration: none; color: var(--color-neutral-300); font-size: 14px;
}
.contents a:hover { background: var(--color-surface); color: var(--color-text); }
/* WHERE YOU ARE, marked on the link rather than only in the title bar. A set
   of pages that never says which one you are reading is a set you get lost
   in, and aria-current carries it to a screen reader as well as to the eye. */
.contents a[aria-current="page"] {
  background: var(--color-surface); color: var(--color-text); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--color-accent);
}
.contents .group + .group { margin-top: 18px; }

/* ---------- the page itself ---------- */
.doc { min-width: 0; max-width: 68ch; }
.doc h1 {
  font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.05;
  margin: 10px 0 12px;
}
.doc section { padding-top: clamp(26px, 4vw, 40px); }
.doc section + section {
  border-top: 1px solid color-mix(in srgb, var(--color-divider) 55%, transparent);
  margin-top: clamp(26px, 4vw, 40px);
}
.doc h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: 12px; }
.doc h3 { font-size: 1.0rem; margin: 20px 0 7px; }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + ol, .doc p + .note, .doc .note + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 20px; }
.doc li + li { margin-top: 6px; }

/* ---------- a promise, quoted ----------
   THE ONE THING ON A PAGE THAT IS NOT PARAPHRASED. Several of these sentences
   are registered surfaces in scripts/promise-registry.mjs: the product states
   them and this is where the detail behind them lives, so a page carrying one
   carries it word for word or the check fails, which is the point of it. */
.promise {
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface));
  padding: clamp(14px, 2.5vw, 20px);
  font-size: 0.98rem;
}
.promise .flag {
  display: block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-accent);
  margin-bottom: 8px;
}

/* ---------- callouts ---------- */
.note {
  border-left: 3px solid var(--color-divider);
  background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 14px 16px; font-size: 0.94rem;
}
.note p + p { margin-top: 9px; }
/* NOT BUILT YET, and it has its own mark because a manual that describes a
   product it wishes existed is worse than no manual. Every page that has one
   of these is saying so in the same voice and in the same place. */
.note.not-yet { border-left-color: var(--color-warn); }
.note .flag {
  display: block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-warn);
  margin-bottom: 7px;
}

/* ---------- the card grid on the contents page ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.cards a {
  display: block; text-decoration: none; color: inherit;
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 18px;
  border: 1px solid transparent;
}
.cards a:hover { border-color: var(--color-accent); color: inherit; }
.cards h3 { font-size: 1.02rem; margin: 0 0 6px; }
.cards p { font-size: 0.9rem; color: var(--color-neutral-400); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--color-divider);
  padding: 30px 0 52px; color: var(--color-neutral-500);
}
footer .frow {
  max-width: 1100px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 28px);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
footer .g { width: 22px; height: 22px; display: block; }
footer .fm { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }

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