/* docs.axmc.xyz — the app's tokens, and the reading layout its Docs page had.
   The values here mirror apps/web/src/styles.css; change them in step. */

:root {
  --paper: #FFFFFF;
  --surface: #F5F7FB;
  --surface-2: #EDF1F8;
  --rule: #E6EAF2;
  --rule-lit: #CFD8E8;

  --ink: #0B1B3F;
  --ink-dim: #4A5A78;
  --muted: #6B7A94;

  --accent: #2563EB;
  --accent-strong: #1D4ED8;
  --accent-sky: #4BA3F5;
  --accent-soft: rgba(37, 99, 235, 0.07);
  --accent-edge: rgba(37, 99, 235, 0.28);

  --sans: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-card: 16px;
  --r-panel: 14px;
  --r-chip: 8px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-color: var(--accent-edge); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

code, .mono { font-family: var(--mono); }
code { font-size: 0.85em; background: var(--surface-2); color: var(--ink); padding: 1px 5px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; text-wrap: balance; margin: 0 0 14px; font-weight: 600; letter-spacing: -0.02em; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-dim); max-width: 68ch; }

/* Shell */
/* The front door's width and gutter (apps/web styles.css, .shell-wide), so
   the two sites' wordmarks stand on the same line when one is opened from
   the other. */
.shell { max-width: 1440px; margin: 0 auto; padding: 0 clamp(20px, 6vw, 96px) 64px; }
@media (max-width: 760px) {
  .shell { padding-bottom: 48px; }
}
.topbar { display: flex; align-items: center; gap: 28px; padding: 16px 0; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 25px; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark-sub { font-weight: 400; color: var(--muted); }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.foot { padding: 40px 0 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); margin-top: 48px; }

/* Two columns from 980px; below that the article comes first and the rail follows it. */
.docs { display: grid; grid-template-columns: 1fr; gap: 36px; padding-top: 24px; }
.docs-rail { order: 2; }
.md { order: 1; min-width: 0; }
@media (min-width: 980px) {
  .docs { grid-template-columns: 240px minmax(0, 1fr); gap: 56px; }
  .docs-rail { order: 1; position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 8px; }
  .md { order: 2; }
}

.doc-list, .toc { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 5px; }
.doc-list a { font-weight: 600; font-size: 15px; color: var(--ink-dim); text-decoration: none; }
.doc-list a:hover { color: var(--ink); }
.doc-list a[aria-current="page"] { color: var(--accent); }
.toc { border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 3px 0 3px 12px; font-size: 13px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }

/* The article */
.md h1 { font-size: clamp(34px, 4.4vw, 50px); margin-bottom: 22px; }
.md h2 { font-size: 27px; margin: 52px 0 16px; padding-top: 20px; border-top: 1px solid var(--rule-lit); }
.md h3 { font-size: 19px; margin: 32px 0 10px; }
.md h4 { font-size: 16px; margin: 24px 0 8px; }
.md p, .md ul, .md ol { max-width: 68ch; color: var(--ink-dim); }
.md li { margin-bottom: 6px; }
.md li > ul, .md li > ol { margin-top: 6px; }
.md strong { color: var(--ink); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.md pre {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-panel);
  padding: 16px 18px; overflow-x: auto; color: var(--ink); max-width: 100%;
}
.md pre code { background: none; padding: 0; font-size: inherit; }
.md table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 16px 0 24px; display: block; overflow-x: auto; }
.md th, .md td { text-align: left; vertical-align: top; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); }
.md td { color: var(--ink-dim); }
.md thead th { font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule-lit); }
.md blockquote { margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--accent-edge); color: var(--muted); }
.md img { max-width: 100%; }
.md input[type="checkbox"] { margin-right: 6px; }
.md .source { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); }

/* The index */
.index-group { margin-top: 40px; }
.index-group h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; padding: 0; border: 0; }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: none; }
@media (min-width: 720px) { .index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.index-list a {
  display: grid; gap: 6px; height: 100%; padding: 18px 20px; text-decoration: none;
  border: 1px solid var(--rule); background: var(--surface); border-radius: var(--r-card);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.index-list a:hover { border-color: var(--accent-edge); box-shadow: 0 10px 24px rgba(11, 27, 63, 0.07); }
.index-list strong { color: var(--ink); font-size: 16px; }
.index-list span { color: var(--ink-dim); font-size: 14px; line-height: 1.5; }

/* ---- The index, the handbook, and pictures ------------------------------- */
/* The mark heads the index: a peak and the spark at its heart, the one
   ornament the docs allow themselves. */
.index-hero { margin: 8px 0 8px; }
.index-hero .peak { display: block; width: 56px; height: 56px; margin: 0 0 18px; }
.index-hero h1 { margin-bottom: 14px; }
.index-hero .lede { margin: 0 0 10px; }
.index-hero .muted { max-width: 68ch; }

/* The handbook is the same site in a quieter key: the eyebrow says who it
   is for, and a thin spark-coloured rule under the bar says it is not the
   public one. */
.site-operator .wordmark-sub { color: #B45309; }
.site-operator .topbar { border-bottom: 1px solid rgba(180, 83, 9, 0.3); }
.site-operator .index-hero .eyebrow { color: #B45309; }

/* A picture in a doc: its own card, so marks are read against an edge rather
   than floating in the margin, and the caption under it stays muted. */
.md p:has(> img:only-child) { max-width: none; margin: 18px 0 24px; padding: 18px 20px 10px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-card); }
.md p:has(> img:only-child) img { display: block; width: 100%; height: auto; }

/* Tables that carry money: the figures line up. */
.md td:has(> code:only-child) { font-variant-numeric: tabular-nums; }

/* The first table on a page is often the one that says who the reader is;
   a hairline above it keeps it from running into the lede. */
.md h1 + p + table { margin-top: 24px; }
