:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --border: #30363d;
  --border-strong: #6e7681;
  --accent: #46b25e;
  --accent-hover: #5bc572;
  --code-bg: #161b22;
  --link: #79c0ff;
  --measure: 760px;
  --wide: 1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  color-scheme: dark;
  scrollbar-color: var(--border) var(--bg);
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

::selection {
  background: rgba(70, 178, 94, 0.35);
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 3px;
}

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

.wide {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

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

main a,
footer a {
  text-decoration: underline;
  text-decoration-color: rgba(121, 192, 255, 0.4);
  text-underline-offset: 0.2em;
}
main a:hover,
footer a:hover { text-decoration-color: currentColor; }

code, pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}

:not(pre) > code { white-space: nowrap; }

a code { color: inherit; }

h1 code, h2 code, h3 code {
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.92em;
}

pre {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
  /* Edge shadows appear only while a block can scroll further that way. */
  background:
    linear-gradient(to right, var(--code-bg) 30%, rgba(22, 27, 34, 0)) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--code-bg) 30%, rgba(22, 27, 34, 0)) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(230, 237, 243, 0.07), transparent) left / 0.6rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(230, 237, 243, 0.07), transparent) right / 0.6rem 100% no-repeat scroll,
    var(--code-bg);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
  font-size: 1em;
}

pre .c { color: var(--fg-muted); }

/* code captions: a config file or a terminal transcript */

figure.file,
figure.term {
  margin: 0 0 1rem;
}

figure.file figcaption,
figure.term figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding: 0.35rem 1.25rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--bg);
}

figure.file pre,
figure.term pre {
  margin: 0;
  border-radius: 0 0 6px 6px;
}

.term .cmd { color: var(--fg); }
.term .cmd::before {
  content: "$ ";
  color: var(--accent);
}
.term .out { color: var(--fg-muted); }
.term .out b {
  color: var(--fg);
  font-weight: 600;
}

/* site header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wide {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { display: block; }

.site-nav ul {
  display: flex;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 1rem 0 0.9rem;
  color: var(--fg-muted);
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.header-download {
  margin-left: auto;
  white-space: nowrap;
}

/* buttons */

.cta {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.cta:hover,
.cta:focus-visible {
  border-color: var(--accent);
  text-decoration: none;
}
.cta.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(70, 178, 94, 0.18);
}
.cta.primary:hover,
.cta.primary:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(70, 178, 94, 0.28);
}
.cta.small,
.cta.small:hover,
.cta.small:focus-visible {
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  box-shadow: none;
  transform: none;
}

.ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}

/* home hero */

.hero {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 70% 80% at 85% 0%, rgba(70, 178, 94, 0.07), transparent 70%),
    var(--bg);
}

.hero .wide {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3.5rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.hero .lead {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0;
}

.hero-demo figure.file { margin-bottom: 0.75rem; }

/* one block per line, so a line that wraps on a phone hangs under its own
   value column instead of restarting at the left edge */
.hero-demo .l {
  display: block;
  padding-left: var(--h, 0);
  text-indent: calc(-1 * var(--h, 0));
}
.hero-demo .l.cmd { --h: 4ch; }
.hero-demo .l.out { --h: 9ch; }
.hero-demo pre { font-size: 0.82rem; }

/* page head on inner pages */

.page-head {
  padding: 3rem 0 0;
}

.page-head h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.page-head .lead {
  font-size: 1.1rem;
  color: var(--fg-muted);
  margin: 0 0 1.5rem;
}

.toc {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}
.toc h2 {
  display: inline;
  font-size: inherit;
  font-weight: 600;
  color: var(--fg-muted);
  border: none;
  margin: 0 0.75rem 0 0;
  padding: 0;
  letter-spacing: 0;
}
.toc .toc-list {
  display: inline;
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc li {
  display: inline-block;
  margin: 0 0.9rem 0 0;
}

/* main sections */

main {
  padding-bottom: 4rem;
}

.hero + main.container,
.page-body {
  padding-top: 2.5rem;
}

section {
  margin-bottom: 3.5rem;
}

h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 2.25rem 0 0.75rem;
  color: var(--fg);
  font-weight: 600;
}

h2 a.self,
h3 a.self {
  color: inherit;
  text-decoration: none;
}
h2 a.self::after,
h3 a.self::after {
  content: "#";
  margin-left: 0.4em;
  color: var(--fg-muted);
  font-weight: 400;
  opacity: 0;
}
h2 a.self:hover::after,
h3 a.self:hover::after,
h2 a.self:focus-visible::after,
h3 a.self:focus-visible::after {
  opacity: 1;
}

p { margin: 0 0 1rem; }

p.note {
  font-size: 0.9rem;
  color: var(--fg-muted);
  border-left: 2px solid var(--border);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1rem 0;
}
p.note strong { color: var(--fg); }

/* numbered first-run steps */

ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

ol.steps > li {
  counter-increment: step;
  margin-bottom: 3rem;
}

ol.steps > li > h2::before {
  content: counter(step);
  display: inline-block;
  min-width: 1.6em;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
}

/* home: each capability beside the config line that does it */

.proofs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.proofs li {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.75rem 1.75rem;
  align-items: start;
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin: 0;
}

.proofs li:first-child { border-top: none; padding-top: 0.25rem; }
.proofs h3 { margin: 0 0 0.4rem; }
.proofs p { margin: 0; color: var(--fg-muted); }
.proofs pre {
  margin: 0;
  font-size: 0.8rem;
}

.doc-index {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-index li {
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.doc-index a {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 0.9rem 0;
  text-decoration: none;
  color: var(--fg);
}
.doc-index a:hover .doc-name { text-decoration: underline; }
.doc-index .doc-name {
  color: var(--link);
  font-weight: 600;
}
.doc-index .doc-desc { color: var(--fg-muted); }

/* page-to-page navigation at the end of a page */

.next-page {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1rem;
}
.next-page a { font-weight: 600; }
.next-page .later { margin-left: auto; text-align: right; }

/* tables */

.table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody th {
  font-weight: 400;
}

th.num, td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--bg-elev);
}

/* lists */

main ul:not([class]),
main ol:not([class]) {
  padding-left: 1.5rem;
}
main ul:not([class]) li,
main ol:not([class]) li {
  margin-bottom: 0.4rem;
}

/* term and definition lists: options, log fields, helpers */

dl.options {
  margin: 0 0 1rem;
  border-top: 1px solid var(--border);
}

dl.options dt {
  padding-top: 0.75rem;
  font-weight: 600;
}

dl.options dd {
  margin: 0.25rem 0 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* disclosure */

details {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 1.1rem;
  margin: 1rem 0 1.25rem;
}
details[open] { padding-bottom: 0.25rem; }
summary {
  cursor: pointer;
  padding: 0.7rem 0;
  font-weight: 600;
}
summary::marker { color: var(--accent); }

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.site-footer .wide {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p { margin: 0.25rem 0; }

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0.25rem 0;
  padding: 0;
}

/* narrower screens */

@media (max-width: 900px) {
  .hero .wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .site-header .wide {
    flex-wrap: wrap;
    gap: 0 1rem;
    padding-top: 0.6rem;
  }
  .site-nav {
    order: 3;
    width: 100%;
  }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav a { padding: 0.45rem 0 0.5rem; }
}

@media (max-width: 600px) {
  .container, .wide { padding: 0 1rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero .lead { font-size: 1.05rem; }
  .hero-demo pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .page-head { padding-top: 2rem; }
  .page-head h1 { font-size: 1.9rem; }
  h2 { font-size: 1.4rem; }
  pre { font-size: 0.8rem; padding: 0.75rem 1rem; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.4rem 0.5rem; }
  code.long {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .proofs li { grid-template-columns: minmax(0, 1fr); }
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
  }
  table.stack thead { display: none; }
  table.stack tr {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }
  table.stack th,
  table.stack td {
    border: none;
    padding: 0.1rem 0;
  }
  table.stack td:empty { display: none; }
  table.stack td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--fg-muted);
  }
  table.stack code { white-space: normal; overflow-wrap: anywhere; }
  .doc-index a {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
  .cta.primary:hover,
  .cta.primary:focus-visible { transform: none; }
}
