/*
 * The root page's styles, as an EXTERNAL file rather than an inline <style>.
 *
 * `/api-reference` unavoidably relaxes `style-src` to `'unsafe-inline'` because Scalar injects its
 * own styles at runtime. That relaxation is stated in `public/_headers` and bought for Scalar
 * alone — writing our own CSS inline would quietly spend it a second time, and make the day
 * somebody tries to tighten the policy back look harder than it is.
 */
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --fg: #e6e9ef;
  --muted: #a8b0bd;
  --accent: #6ee7c8;
  --border: rgba(255, 255, 255, 0.1);
  --surface: #14171d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  line-height: 1.6;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}

h2 {
  margin: 2.5rem 0 0.5rem;
  font-size: 1.25rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.cards li {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 1.25rem;
}

.cards h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.cards p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

a {
  color: var(--accent);
}

/* SC 2.5.8 — a link that is the whole line of its own block is not covered by the
   in-a-sentence exemption, so it has to be a box big enough to hit. */
.cards h2 a {
  display: inline-block;
  padding-block: 0.25rem;
  min-height: 1.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 2.5rem;
}

/* ── Quickstart steps ─────────────────────────────────────────────────────── */
/*
 * The numbered rhythm is the landing's `MigrationSection`, reused so a reader who saw the migration
 * steps there recognises the shape here.
 */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 2rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.75;
}

.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.steps p {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

/*
 * `overflow-x: auto` on the block itself, never on the page: a long curl line scrolls inside its
 * own box so the document never scrolls sideways.
 */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* ── Callout ──────────────────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ── Identifier lists ─────────────────────────────────────────────────────── */
/*
 * 34 error codes and 60 topics. Columns keep them scannable instead of turning the page into one
 * long ribbon; the bullet goes because the identifier IS the content.
 */
.id-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.25rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.id-list li {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.75rem;
  font-size: 0.95rem;
}

/* SC 2.5.8 — an inline anchor's height is its line box; this makes it a box big enough to hit. */
.id-list a,
.cards h3 a {
  display: inline-block;
  padding-block: 0.25rem;
  min-height: 1.5rem;
}

.chip {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  color: var(--muted);
  white-space: nowrap;
}
