/* One stylesheet, no framework, no web fonts. The page should render
   instantly on a bad connection and read correctly in either theme. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-code: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --border: #d1d9e0;
  --accent: #0b7a6d;
  --accent-soft: #dcf5f0;
  --good: #1a7f37;
  --warn: #9a6700;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #151b23;
    --bg-code: #151b23;
    --fg: #e6edf3;
    --fg-muted: #9198a1;
    --border: #3d444d;
    --accent: #3cc5b0;
    --accent-soft: #0f2926;
    --good: #3fb950;
    --warn: #d29922;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 56px 0 44px;
}

h1 {
  margin: 0 0 6px;
  font-size: 2.6rem;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0 0 22px;
  font-size: 1.3rem;
  color: var(--fg-muted);
  max-width: 34ch;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.badges img { height: 20px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.94rem;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }

main { padding: 8px 0 72px; }

section { padding-top: 46px; }

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1.06rem; margin: 26px 0 6px; }

p { margin: 14px 0; }

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  font: 13.5px/1.55 var(--mono);
  margin: 14px 0;
}

code { font-family: var(--mono); font-size: 0.9em; }
p code, li code, td code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
pre code { background: none; border: 0; padding: 0; }

table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.94rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; background: var(--bg-soft); }

.layers { list-style: none; padding: 0; margin: 18px 0; counter-reset: layer; }
.layers li {
  counter-increment: layer;
  position: relative;
  padding: 14px 0 14px 46px;
  border-bottom: 1px solid var(--border);
}
.layers li::before {
  content: counter(layer);
  position: absolute;
  left: 0; top: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
  display: grid;
  place-items: center;
}
.layers strong { display: block; }

.note {
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 18px 0;
  border-radius: 0 6px 6px 0;
}
.note.caution { border-left-color: var(--warn); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 18px 0; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: var(--bg-soft); }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card p { margin: 0; font-size: 0.92rem; color: var(--fg-muted); }

.stat { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--good); }

footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 50px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
footer a { color: var(--fg-muted); text-decoration: underline; }

@media (max-width: 600px) {
  header { padding: 38px 0 32px; }
  h1 { font-size: 2rem; }
  .tagline { font-size: 1.1rem; }
}

/* ---- navigation ------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--fg);
  flex: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 26px; height: 26px; display: block; }

/* The link row scrolls sideways on a narrow screen rather than wrapping into
   a second row and pushing the page content down. */
.nav-links {
  display: flex;
  gap: 16px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--fg-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--fg); text-decoration: none; border-bottom-color: var(--accent); }

/* Anchors must clear the sticky bar, or a heading lands underneath it. */
section { scroll-margin-top: 72px; }

/* ---- header lock-up --------------------------------------------------- */

.hero { display: flex; align-items: flex-start; gap: 18px; }
.hero-logo { width: 72px; height: 72px; flex: none; }

@media (max-width: 600px) {
  .nav-links { gap: 13px; }
  .nav-links a { font-size: 0.86rem; }
  .hero { gap: 13px; }
  .hero-logo { width: 52px; height: 52px; }
}
/* In dark mode the accent is light, so white button text would sit at about
   2:1 contrast. Dark text on it is nearer 8:1. */
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #04201c; }
}

.results td:not(:first-child), .results th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.results tr.best td { font-weight: 700; }

/* A wide table scrolls inside its own box on a phone, rather than widening
   the whole page and making every line scroll sideways. */
.table-scroll { overflow-x: auto; margin: 16px 0; }
.table-scroll table { margin: 0; min-width: 540px; }
