/* LOGIC brand: ink #24242f, magenta → orange signature; system fonts only. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f6f6f8;
  --edge: #e3e3e8;
  --ink: #24242f;
  --muted: #55555f;
  --link: #9c00b8;
  --accent-from: #c41fe0;
  --accent-to: #d95700;
  --mark-bg: #fff1c2;
  --mark-ink: #4a3500;
  --button-bg: #24242f;
  --button-ink: #ffffff;
  --button-hover: #3a3a4a;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: max(16px, 4vw);
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a22;
    --surface: #24242f;
    --edge: #363644;
    --ink: #f4f4f5;
    --muted: #b4b4be;
    --link: #d6ff7f;
    --accent-from: #e233ff;
    --accent-to: #ff6b00;
    --mark-bg: #4a3a00;
    --mark-ink: #ffe9a3;
    --button-bg: #d6ff7f;
    --button-ink: #1a1a22;
    --button-hover: #e6ffb0;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
}
.skip:focus { top: 0.75rem; }

header.site {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--edge);
}
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.wordmark span { color: var(--muted); font-weight: 500; }

nav ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

main { flex: 1; padding-block: 2.5rem 3.5rem; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.4rem + 2.2vw, 2.625rem); margin: 0 0 1rem; }
h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol, table { margin: 0 0 1rem; }
li { margin-block: 0.35rem; }

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

.updated { color: var(--muted); font-size: 0.9375rem; }

.summary {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.summary > :last-child { margin-bottom: 0; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--edge); }
th { font-weight: 600; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
}

/* Text the maintainer must replace before the site is published. */
mark.todo {
  background: var(--mark-bg);
  color: var(--mark-ink);
  border-radius: 3px;
  padding: 0 0.25em;
  font-weight: 600;
}

footer.site {
  border-top: 1px solid var(--edge);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
footer.site p { margin: 0; }
footer.site a { color: var(--muted); }

th[scope="row"] { width: 34%; }
.where { display: block; color: var(--muted); font-weight: 400; font-size: 0.875rem; }

.cta { margin-top: 1.5rem; }
.button {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-ink);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--button-hover); text-decoration: none; }
.button:focus-visible { outline-color: var(--link); }

.callout {
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem 0.25rem;
  border: 1px solid var(--edge);
  border-left: 4px solid var(--accent-from);
  border-radius: 10px;
  background: var(--surface);
}
.callout h2 { margin-top: 0; font-size: 1.1875rem; }

.crumbs { color: var(--muted); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }

.note {
  border-left: 4px solid var(--accent-to);
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}
.note > :last-child { margin-bottom: 0; }

pre {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 8px;
  font: 0.8125rem/1.55 var(--mono);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }

.toc { columns: 2 14rem; column-gap: 2rem; }
.toc li { break-inside: avoid; }

.soon {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  color: var(--muted);
  vertical-align: 0.1em;
}
th[scope="row"] code { overflow-wrap: normal; white-space: nowrap; }
th[scope="row"] .soon { margin-top: 0.25rem; }
