/* Shared by the landing page, the docs (docs/site/_layout.html) and the 404. */
:root {
  color-scheme: dark;
  --bg: oklch(0.205 0.03 158);
  --fg: oklch(0.96 0.028 98);
  --muted: oklch(0.82 0.024 98);
  --faint: oklch(0.68 0.022 110);
  --leaf: oklch(0.8 0.15 148);
  --gold: oklch(0.875 0.13 90);
  --rust: oklch(0.78 0.13 35);
  --border: oklch(0.96 0.028 98 / 0.12);
  --hairline: oklch(0.96 0.028 98 / 0.07);
  --well: oklch(0.15 0.024 158);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: "Quicksand", "Satoshi", system-ui, sans-serif;
  /* Type scale. Display sizes (h1, h2) are set per page with clamp(). */
  --text-xs: .8125rem;  /* 13px: code blocks, table headers */
  --text-sm: .875rem;   /* 14px: captions, footer, sidebar, tables */
  --text-base: 1rem;    /* 16px: body */
  --text-lg: 1.125rem;  /* 18px: subheads, summaries */
  --text-xl: 1.25rem;   /* 20px: the landing lede */
}
::selection { background: oklch(0.875 0.13 90 / 0.28); }
* { box-sizing: border-box; }
/* clip, not hidden: hidden would make body a scroll container and break sticky. */
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  font: 400 1rem/1.6 "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Only the weights and styles we load render; nothing gets faked. */
  font-synthesis: none;
}
a { color: inherit; }
code, pre { font-family: var(--mono); font-variant-ligatures: none; }
/* Inline code sits a step below the text around it; mono faces run large. */
:not(pre) > code { font-size: .875em; }
h1, h2, h3 { text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

/* Header and footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 44px; height: 44px; margin: -4px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.015em; line-height: 1; }
.wordmark .x {
  background: linear-gradient(150deg in oklch, oklch(0.9 0.13 95) 0%, oklch(0.86 0.16 122) 45%, oklch(0.77 0.16 148) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.top nav { display: flex; gap: 22px; font-size: var(--text-base); }
.top nav a, footer a { position: relative; color: var(--muted); text-decoration: none; transition: color 150ms ease; }
.top nav a::before, footer a::before { content: ""; position: absolute; inset: -9px -8px; }
footer { padding-top: 32px; padding-bottom: max(48px, env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); color: var(--faint); font-size: var(--text-sm); }
footer nav { display: flex; gap: 20px; }

/* Terminal output and code blocks */
pre {
  margin: 0; padding: 20px 22px; border-radius: 12px; background: var(--well);
  overflow-x: auto; font-size: var(--text-xs); line-height: 1.7; color: var(--muted); tab-size: 2;
}
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: oklch(0.96 0.028 98 / 0.2); border-radius: 4px; }
pre::-webkit-scrollbar-track { background: transparent; }

/* Syntax tokens: docs code blocks (cmd/sitegen/highlight.go) and the landing terminals. */
.bin { color: var(--leaf); font-weight: 600; }
.key, .tpl { color: var(--leaf); }
.str, .ph, .num { color: var(--gold); }
.flag, .op, .cm { color: var(--faint); }
/* console blocks: the commands in ivory behind a faint prompt, their output muted. */
.run { color: var(--fg); }
.pr { color: var(--faint); user-select: none; }

/* Prose links: underline weight and position from the font's own metrics. */
.link, article a, main a { text-decoration-thickness: from-font; text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .top nav a:hover, footer a:hover { color: var(--fg); }
}
@media (pointer: coarse) {
  .top nav a::before { inset: -10px -9px; }
  footer a::before { inset: -11px -9px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
