:root {
  color-scheme: dark;
  --bg: #0f1412;
  --panel: #161f1b;
  --panel-alt: #1b2621;
  --ink: #edf2ea;
  --muted: #9ca89c;
  --line: #2e3a31;
  --accent: #b5d98b;
  --blue: #8fcaff;
  --warm: #f3d293;
  --danger: #ffaba6;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 12px 5vw;
  background: #0f1412eb;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #142011;
  border-radius: 7px;
  font: italic 800 20px Georgia, serif;
}
.brand small {
  font: 500 11px var(--mono);
  letter-spacing: 1.8px;
  color: var(--muted);
  text-transform: uppercase;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nav a {
  font: 500 12.5px var(--mono);
  color: var(--ink);
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color .12s, background .12s;
}
.nav a:hover, .nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #b5d98b14;
}
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 5vw 64px;
}
.container:has(.spec-layout) {
  max-width: 1600px;
}
.hero {
  padding: 28px 0 36px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font: 600 11px var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -1.4px;
  margin: 0 0 16px;
}
.lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 74ch;
  margin: 0 0 24px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 7px;
  font: 600 13px var(--mono);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #142011;
}
.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card h3 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}
.card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.card .tag {
  font: 600 11px var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.6px;
  margin: 40px 0 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font: 13px/1.5 var(--mono);
  margin: 16px 0 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
th {
  color: var(--accent);
  background: var(--panel-alt);
  font-weight: 600;
}
pre, code {
  font-family: var(--mono);
  font-size: 12.5px;
}
pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}
.spec-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.spec-toc {
  position: sticky;
  top: 68px;
  max-height: calc(100dvh - 88px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: 12px/1.45 var(--mono);
}
.spec-toc input {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 12px var(--mono);
}
.spec-toc a {
  display: block;
  padding: 4px 6px;
  color: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spec-toc a:hover {
  color: var(--accent);
  background: #b5d98b14;
  text-decoration: none;
}
.spec-body {
  font-size: 15px;
  line-height: 1.7;
}
.spec-body p {
  max-width: 80ch;
  margin: 0.6em 0;
}
.spec-body h2, .spec-body h3, .spec-body h4 {
  scroll-margin-top: 76px;
}
.spec-body h2 {
  font-size: 22px;
  margin-top: 48px;
}
.spec-body h3 {
  font-size: 18px;
  margin-top: 36px;
}
.spec-body h4 {
  font-size: 15px;
  margin-top: 28px;
}
.spec-body pre {
  font-size: 13px;
  line-height: 1.55;
}
.spec-body table {
  font-size: 12.5px;
  line-height: 1.45;
}
.spec-body ul {
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.spec-body li {
  margin: 0.3em 0;
  max-width: 80ch;
}
@media (max-width: 860px) {
  .spec-layout { grid-template-columns: minmax(0, 1fr); }
  .spec-toc { position: static; max-height: 260px; }
}
