:root {
  --bg: #08090b;
  --surface: #101216;
  --surface-2: #171a1f;
  --border: #1f2329;
  --text: #e8e6e3;
  --muted: #8b9199;
  --accent: #e2543a;
  --accent-strong: #c4402a;
  --warn: #e0a33a;
  --ok: #4ea87a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 62rem;
  --header-h: 60px;
}

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

html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

/* the header is sticky, so anchored targets have to clear it */
[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

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

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; margin: 2.75rem 0 0.85rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: 0.4rem; }
strong { color: #fff; font-weight: 600; }

code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

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

/* header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 11, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.brand {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand-mark { display: block; width: 34px; height: 34px; object-fit: contain; }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-size: 0.94rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* hero */
.hero { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 2.5rem; align-items: center; }
.hero-art { width: min(300px, 34vw); height: auto; justify-self: end; }
.hero h1 { font-size: 3rem; max-width: 22ch; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 58ch; margin-bottom: 1.75rem; }
.hero .lede strong { color: var(--text); font-weight: 500; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--muted); filter: none; }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* notices */
.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  background: var(--surface);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.notice p:last-child { margin-bottom: 0; }
.notice-title { color: var(--warn); font-weight: 600; display: block; margin-bottom: 0.25rem; }
.notice-accent { border-left-color: var(--accent); }
.notice-accent .notice-title { color: var(--accent); }

/* sections and grids */
section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--border); }
.section-lede { color: var(--muted); max-width: 62ch; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin-top: 1.75rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 1.25rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .muted { color: var(--muted); font-size: 0.94rem; }

a.card { color: var(--text); display: block; }
a.card:hover { border-color: var(--accent); text-decoration: none; }
a.card h3 { color: var(--text); }
a.card:hover h3 { color: var(--accent); }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
td code { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* figures */
figure { margin: 1.75rem 0; }
figure img { border: 1px solid var(--border); border-radius: 8px; display: block; }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.6rem; }

/* docs */
.doc { padding-top: 3rem; padding-bottom: 4rem; }
.doc h1 { font-size: 2rem; }
.doc .kicker { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; font-weight: 600; }
.doc > p:first-of-type { color: var(--muted); font-size: 1.08rem; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin: 1.75rem 0; }
.toc ul { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: 0.2rem; font-size: 0.95rem; }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-grid { display: flex; gap: 2.5rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-note { max-width: 46ch; }

@media (max-width: 640px) {
  :root { --header-h: 104px; }
  body { font-size: 16px; }
  .wrap { padding: 0 1.5rem; }
  .hero { padding: 3rem 0 2.25rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-art { width: 190px; justify-self: start; order: -1; }
  .nav { height: auto; padding: 0.75rem 0; flex-wrap: wrap; gap: 0.75rem 1rem; }
  .nav-links { margin-left: 0; width: 100%; gap: 1rem; }
}
