/*
 * The console's tokens from dashboard/src/styles/tokens.css, with one change:
 * the dark set hangs off prefers-color-scheme rather than [data-theme],
 * because this site ships no JavaScript and so has no theme toggle to read.
 */
:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-muted: #f1efec;
  --border: #e6e3de;
  --text: #333333;
  --text-muted: #6f6f6f;
  --accent: #ff6400;
  --accent-ink: #c24a00;
  --radius-card: 18px;
  --lift: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 24px -16px rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1e1e1e;
    --surface-muted: #262626;
    --border: #2f2f2f;
    --text: #ffffff;
    --text-muted: #cccccc;
    --accent-ink: #ff8f4d;
    --lift: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 24px -16px rgba(0, 0, 0, 0.9);
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

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

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: baseline;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.mark {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.mark span { color: var(--accent-ink); }

.bar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.bar nav a { color: var(--text-muted); text-decoration: none; }
.bar nav a:hover { color: var(--text); text-decoration: underline; }
.bar nav a[aria-current="page"] { color: var(--text); font-weight: 500; }

/* ---- the document ---- */

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--lift);
  padding: clamp(20px, 5vw, 48px);
}

/* The card is the whole document, so target what is inside it directly. */
main h1 {
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}

main h2 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  margin: 40px 0 12px;
  padding-top: 4px;
}

main h3 { font-size: 16px; font-weight: 600; margin: 28px 0 8px; }

main p { margin: 0 0 16px; }
main ul, main ol { margin: 0 0 16px; padding-left: 22px; }
main li { margin-bottom: 6px; }
main strong { font-weight: 600; }

main hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

main em { color: var(--text-muted); }

/* ---- tables ---- */

.scroll { overflow-x: auto; margin: 0 0 20px; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-size: 15px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface-muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child { border-top-right-radius: 8px; }
tbody tr:last-child td { border-bottom: 0; }

/* ---- the index ---- */

.lede { font-size: 18px; color: var(--text-muted); }

.cards { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }

.cards a {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  text-decoration: none;
  color: var(--text);
}
.cards a:hover { border-color: var(--accent); }
.cards strong { font-weight: 600; color: var(--accent-ink); }
.cards span { color: var(--text-muted); font-size: 15px; line-height: 1.5; }

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

footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 56px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
footer p { margin: 0 0 8px; }

/*
 * The footer sits on --bg, not on the card, and --accent-ink there measures
 * 4.43:1 at 14px — just under. Nudged toward --text the same way Chip.tsx
 * does it, which works in both themes because --text is the far end of the
 * contrast range in each.
 */
footer a { color: color-mix(in srgb, var(--accent-ink) 82%, var(--text)); }
