:root {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --text: #16202c;
  --muted: #566273;
  --line: #d9dee6;
  --accent: #0f7b6c;
  --accent-strong: #0a5c51;
  --accent-soft: #d9f0ec;
  --code-bg: #0f1720;
  --code-text: #d7e0ea;
  --ok: #3fbf8f;
  --high: #ff7a6b;
  --low: #e6c35c;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 32, 0.08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-alt: #121821;
    --surface: #161d27;
    --text: #e6ebf1;
    --muted: #9aa6b5;
    --line: #273140;
    --accent: #3cc2ab;
    --accent-strong: #62d6c2;
    --accent-soft: #123a35;
    --code-bg: #0a0f15;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

code, pre { font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace; }

:not(pre) > code {
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.nav nav { display: flex; align-items: center; gap: 22px; }
.nav nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav a:not(.btn):hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }
.btn-small { padding: 7px 16px; font-size: 0.9rem; }
@media (prefers-color-scheme: dark) {
  .btn:not(.btn-ghost) { color: #06231f; }
}

/* Hero */
.hero { padding: 88px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.02em; margin: 0 0 12px; font-size: 0.92rem; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 18px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 1.12rem; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.note { color: var(--muted); font-size: 0.9rem; margin-top: 18px; }

/* Report and terminal */
.report, .terminal {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report figcaption {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font: 0.8rem ui-monospace, Menlo, Consolas, monospace;
  color: #8c99a8;
  border-bottom: 1px solid #1f2a36;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #2c3846; }
.report pre, .terminal { margin: 0; padding: 20px 22px; overflow-x: auto; font-size: 0.86rem; line-height: 1.65; }
.report pre { background: none; }
.report .h { color: #7fb4ff; }
.report i { color: #7c8898; font-style: normal; }
.ok { color: var(--ok); }
.hi { color: var(--high); }
.lo { color: var(--low); }
.terminal .c { color: #6f7c8c; }

/* Band */
.band { background: var(--accent-soft); padding: 40px 0; }
.pull { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.45rem); font-weight: 600; line-height: 1.45; max-width: 900px; }
.pull span { display: block; color: var(--muted); font-weight: 400; font-size: 1rem; margin-top: 8px; }

/* Sections */
.section { padding: 84px 0; }
.alt { background: var(--bg-alt); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.two-col p { color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 14px;
}
.steps p, .card p { color: var(--muted); margin: 0; font-size: 0.96rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 14px 46px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.final { text-align: center; }
.center { text-align: center; justify-content: center; }
.final .lead { margin-inline: auto; max-width: 640px; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 960px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 48px; }
  .section { padding: 60px 0; }
  .nav-inner { flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; min-height: 0; }
  .nav nav { gap: 14px; overflow-x: auto; max-width: 100%; }
  .nav nav a:not(.btn) { font-size: 0.88rem; white-space: nowrap; }
  .nav nav .btn { display: none; }
  .steps, .cards { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Multi-page additions: navigation state, page headers, prose, tables,
   copyable code, OS tabs, downloads and the reference layout.
   --------------------------------------------------------------------------- */

.nav nav a[aria-current="page"]:not(.btn) { color: var(--text); font-weight: 600; }

.page-head { padding: 64px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-bottom: 12px; }
.page-head .lead { margin-bottom: 0; max-width: 760px; }

.prose { max-width: 820px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }

.kicker { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* Numbered walkthrough (getting started) */
.walk { list-style: none; margin: 0; padding: 0; counter-reset: walk; display: grid; gap: 56px; }
.walk > li { counter-increment: walk; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 20px; }
.walk > li::before {
  content: counter(walk);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.walk h2 { font-size: 1.45rem; margin: 4px 0 10px; }
.walk p, .walk li li { color: var(--muted); }
.walk p { margin: 0 0 14px; }

/* Code blocks with a copy button */
.code { position: relative; margin: 14px 0 18px; }
.code pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}
.code pre .c, .code pre .p { color: #6f7c8c; }
.code pre .p { user-select: none; }
.code pre .o { color: #9fb0c2; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 600 0.75rem system-ui, sans-serif;
  color: #c6d1dd;
  background: #1c2733;
  border: 1px solid #2c3846;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  opacity: 0.85;
}
.copy:hover { opacity: 1; }
.copy.done { color: var(--ok); }

/* OS tabs */
.tablist { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-top: 10px; }
.tablist button {
  font: inherit;
  font-size: 0.92rem;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  margin-bottom: -1px;
  color: var(--muted);
  cursor: pointer;
}
.tablist button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* Callouts */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 8px; padding: 14px 18px; margin: 16px 0; color: var(--muted); font-size: 0.95rem; }
.callout strong { color: var(--text); }
.callout.warn { border-left-color: var(--low); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg-alt); }
td code { white-space: nowrap; }
td.desc { color: var(--muted); min-width: 260px; }
.sev { display: inline-block; font: 700 0.75rem ui-monospace, Menlo, Consolas, monospace; padding: 2px 8px; border-radius: 999px; }
.sev-high { background: color-mix(in srgb, var(--high) 20%, transparent); color: color-mix(in srgb, var(--high) 70%, var(--text)); }
.sev-medium { background: color-mix(in srgb, var(--low) 25%, transparent); color: color-mix(in srgb, var(--low) 50%, var(--text)); }
.sev-low { background: var(--bg-alt); color: var(--muted); }

/* Why it saves time */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.compare > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.compare h3 { display: flex; align-items: center; gap: 10px; }
.compare ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.compare li { margin-bottom: 8px; }
.compare .with { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); }
.with .tag { background: var(--accent-soft); color: var(--accent); }

.gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 44px; }
.gains h3 { font-size: 1.05rem; }
.gains p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* Annotated example report */
.annotated { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; margin-top: 36px; align-items: start; }
.annotated .report pre { font-size: 0.82rem; }
.report .m { background: var(--accent); color: #fff; border-radius: 50%; display: inline-grid; place-items: center; width: 18px; height: 18px; font: 700 0.7rem system-ui, sans-serif; vertical-align: 1px; margin-left: 6px; }
.notes { list-style: none; counter-reset: note; margin: 0; padding: 0; display: grid; gap: 18px; }
.notes li { counter-increment: note; position: relative; padding-left: 40px; color: var(--muted); font-size: 0.96rem; }
.notes li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}
.notes strong { color: var(--text); display: block; }

/* Downloads */
.dl-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.dl-hero h2 { margin-bottom: 6px; }
.dl-meta { color: var(--muted); font-size: 0.92rem; margin: 0 0 20px; }
.btn-big { font-size: 1.05rem; padding: 14px 26px; }
.dl-sub { color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; }
.platforms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.platforms a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  background: var(--bg);
}
.platforms a:hover { border-color: var(--accent); }
.platforms a.current { border-color: var(--accent); background: var(--accent-soft); }
.platforms small { color: var(--muted); }

.releases { display: grid; gap: 14px; margin-top: 24px; }
.release { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.release > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding: 18px 22px; }
.release > summary::-webkit-details-marker { display: none; }
.release > summary::after { content: "Show"; margin-left: auto; color: var(--accent); font-size: 0.88rem; font-weight: 600; }
.release[open] > summary::after { content: "Hide"; }
.release h3 { margin: 0; font-size: 1.15rem; }
.release time { color: var(--muted); font-size: 0.9rem; }
.badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.pre { background: color-mix(in srgb, var(--low) 25%, transparent); color: color-mix(in srgb, var(--low) 50%, var(--text)); }
.release-body { padding: 4px 22px 22px; border-top: 1px solid var(--line); }
.release-body .table-wrap { background: var(--bg); }
.release-notes { color: var(--muted); font-size: 0.94rem; max-height: 420px; overflow: auto; padding-right: 8px; }
.release-notes h2, .release-notes h3 { font-size: 1.02rem; color: var(--text); margin: 18px 0 6px; }
.release-notes ul { padding-left: 20px; }
.status { color: var(--muted); font-size: 0.92rem; }

/* Reference layout */
.ref { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding: 40px 0 84px; }
.ref-side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 12px; }
.ref-side input {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 8px;
}
.ref-side input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ref-side ul { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.ref-side li a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.ref-side li a:hover, .ref-side li a.active { color: var(--text); background: var(--bg-alt); }
.ref-side .group { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 16px 10px 4px; }
.ref-main > section { scroll-margin-top: 84px; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.ref-main > section:last-of-type { border-bottom: 0; }
.ref-main h2 { font-size: 1.6rem; }
.ref-main h3 { font-size: 1.1rem; margin-top: 26px; }
.ref-main p, .ref-main li { color: var(--muted); }
.ref-main tr[id] { scroll-margin-top: 90px; }
.ref-main tr:target td { background: var(--accent-soft); }
.ref-main mark { background: color-mix(in srgb, var(--low) 45%, transparent); color: inherit; border-radius: 2px; }
.filter-count { color: var(--muted); font-size: 0.82rem; margin: 0 2px 8px; min-height: 1.2em; }
.no-match { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  .walk > li::before, .report .m { color: #06231f; }
}

@media (max-width: 960px) {
  .compare, .annotated, .dl-hero { grid-template-columns: 1fr; }
  .gains { grid-template-columns: 1fr; }
  .ref { grid-template-columns: 1fr; gap: 20px; }
  .ref-side { position: static; max-height: none; }
  .ref-side ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .ref-side .group { width: 100%; }
}

@media (max-width: 640px) {
  .walk > li { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .platforms { grid-template-columns: 1fr; }
  .dl-hero { padding: 22px; }
  .page-head { padding: 44px 0 24px; }
}

/* Grid items default to min-width: auto, which lets long code lines widen
   the whole page on phones. */
.hero-grid > *, .two-col > *, .annotated > *, .compare > *, .dl-hero > *, .ref > * { min-width: 0; }
