:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-soft: #4d525c;
  --ink-faint: #767c88;
  --rule: #e3e4e8;
  --accent: #1d6b4f;
  --accent-soft: #e8f2ed;
  --code-bg: #14161a;
  --code-ink: #e6e8ec;
  --warn-bg: #fdf3e7;
  --warn-rule: #d9a441;
  --measure: 56rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #14171d;
    --ink: #e9ebef;
    --ink-soft: #b3b8c2;
    --ink-faint: #838a97;
    --rule: #262a33;
    --accent: #5fbf95;
    --accent-soft: #13291f;
    --code-bg: #0a0c0f;
    --code-ink: #e6e8ec;
    --warn-bg: #2a2113;
    --warn-rule: #a37c2b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

header.site {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding-top: 1rem; padding-bottom: 1rem;
  max-width: var(--measure);
}
header.site a.brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
/* the mark takes its body colour from the link, so it follows the theme */
header.site a.brand .mark {
  color: var(--accent);
  flex: none;
  border-radius: 7px;
  transition: transform .12s ease;
}
header.site a.brand:hover .mark { transform: translateY(-1px) rotate(-2deg); }
header.site .wrap { align-items: center; }
header.site nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
header.site nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.92rem;
}
header.site nav a:hover { color: var(--accent); }

/* .wrap is a class and outranks the bare `main` selector, so the vertical padding
   has to be set on the combined selector or it is silently dropped. */
main.wrap { padding: 3.25rem 1.5rem 5rem; }

h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.2; letter-spacing: -0.022em;
  margin: 0 0 0.75rem;
}
h2 {
  font-size: 1.3rem; letter-spacing: -0.012em;
  margin: 2.75rem 0 0.75rem; padding-top: 0.4rem;
}
h3 { font-size: 1.05rem; margin: 1.9rem 0 0.5rem; }

p, li { color: var(--ink-soft); }
p { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
strong { color: var(--ink); font-weight: 650; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.lede { font-size: 1.1rem; color: var(--ink-soft); }

.answer {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.15rem;
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
}
.answer p:last-child { margin-bottom: 0; }
.answer strong { color: var(--ink); }

.note {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-rule);
  padding: 0.9rem 1.15rem;
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.note p:last-child { margin-bottom: 0; }

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.1rem 0;
}
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
:not(pre) > code {
  background: var(--rule);
  color: var(--ink);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  font-size: 0.88em;
}
pre code { background: none; padding: 0; color: inherit; }

.install {
  display: inline-block;
  background: var(--code-bg); color: var(--code-ink);
  padding: 0.65rem 1rem; border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem; margin: 0.5rem 0 1.5rem;
}

.scroll { overflow-x: auto; margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { color: var(--ink); font-weight: 650; white-space: nowrap; }
td { color: var(--ink-soft); vertical-align: top; }
td code { white-space: nowrap; }

.faq h3 { font-size: 1rem; margin-top: 1.6rem; }

footer.site {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 3rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
footer.site a { color: var(--ink-faint); }

.pill {
  display: inline-block; font-size: 0.75rem; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent);
  padding: 0.2rem 0.55rem; border-radius: 999px; margin-bottom: 0.9rem;
  font-weight: 600; text-transform: uppercase;
}

img, svg { max-width: 100%; height: auto; }

/* validator page */
.dropzone {
  border: 2px dashed var(--rule, #c9cdd4);
  border-radius: 10px;
  padding: 2.4rem 1.2rem;
  text-align: center;
  cursor: pointer;
  margin: 1.6rem 0 0.8rem;
  transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone:focus, .dropzone.over {
  border-color: #2f6f4f;
  background: rgba(47, 111, 79, .05);
  outline: none;
}
.dz-main { margin: 0; font-size: 1.05rem; font-weight: 600; }
.dz-sub { margin: .3rem 0 0; font-size: .9rem; opacity: .7; }
#result { margin: 1.4rem 0 2rem; }
.verdict { font-weight: 600; margin: 0 0 .6rem; }
.verdict.ok { color: #2f6f4f; }
.verdict.bad { color: #a3342b; }
.issues { margin: .4rem 0 1rem; padding-left: 1.1rem; }
.issues li { margin: .35rem 0; line-height: 1.45; }
.issues li.err::marker { color: #a3342b; }
.issues li.warn::marker { color: #b07d20; }
#result .sub { font-size: .93rem; opacity: .82; }

/* Prose stays readable while tables, code and the drop zone use the full column. */
main.wrap > p,
main.wrap > ul,
main.wrap > ol,
.faq > p,
.faq > ul { max-width: 46rem; }

main.wrap > h1 { margin-top: 0; }
footer.site .wrap { padding-top: 1.5rem; padding-bottom: 1.5rem; }

@media (max-width: 640px) {
  main.wrap { padding: 2rem 1.15rem 3.5rem; }
  header.site .wrap { flex-direction: column; gap: 0.6rem; }
}

/* figures — the SVGs read these, so they follow the theme */
:root {
  --fig-surface: #ffffff; --fig-rule: #e3e4e8; --fig-ink: #16181d;
  --fig-soft: #4d525c; --fig-head: #f1f2f4;
  --fig-accent: #1d6b4f; --fig-accent2: #8bbfa8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fig-surface: #14171d; --fig-rule: #2b303a; --fig-ink: #e9ebef;
    --fig-soft: #a2a9b5; --fig-head: #1b1f27;
    --fig-accent: #5fbf95; --fig-accent2: #2f6f57;
  }
}
figure {
  margin: 1.75rem 0;
  padding: 0;
}
figure img, figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}
figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--ink-faint);
  max-width: 46rem;
}

/* screenshots are raster: never upscale them past their own pixels or they go soft */
figure.shot img {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}
figure.shot { text-align: center; }
figure.shot figcaption { text-align: left; margin-left: auto; margin-right: auto; }
