:root {
  --bg: #0b0d10; --surface: #12161b; --surface-2: #171c23; --line: #252c36;
  --text: #e7eaee; --muted: #97a1af; --accent: #f0a93b; --ok: #5fd39a; --error: #ff7a7a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
code, pre { font-family: var(--mono); font-size: 14px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 4px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 10; background: rgba(11,13,16,.96); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { border-radius: 6px; }
nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav a:hover { color: var(--text); }

.btn { display: inline-block; background: var(--accent); color: #161006; border: 0; border-radius: 6px; padding: 12px 22px; font: 600 16px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: #f6bb5c; }
.btn.small { padding: 8px 14px; font-size: 14px; }
nav a.btn { color: #161006; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--muted); background: transparent; }
.btn[disabled] { opacity: .6; cursor: wait; }

.hero { padding: 80px 0 72px; }
.hero-grid > *, .cap > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.kicker { font: 500 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 18px; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 650; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 1.1rem; margin: 22px 0 30px; max-width: 56ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0; margin: 36px 0 0; color: var(--muted); font-size: 15px; }
.facts strong { color: var(--text); }

.trace { margin: 0; }
pre { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.trace figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.c { color: #8a94a3; }
.hl { font-weight: 500; color: var(--accent); background: rgba(240,169,59,.1); padding: 1px 3px; border-radius: 3px; }

.band { border-block: 1px solid var(--line); background: var(--surface); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-block: 40px; }
.trio h3 { margin-bottom: 8px; }
.trio p { color: var(--muted); font-size: 15px; }

.section { padding: 96px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.sub { color: var(--muted); margin: 12px 0 48px; max-width: 62ch; }

.cap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); align-items: start; }
.cap pre { position: sticky; top: 88px; }
.tag { font: 500 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.cap h3 { font-size: 1.4rem; margin-bottom: 16px; }
dl { margin: 0; display: grid; grid-template-columns: 112px 1fr; gap: 10px 20px; }
dt { font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 4px; }
dd { margin: 0; color: #cdd3db; font-size: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px 14px 0; border-top: 1px solid var(--line); vertical-align: top; }
th { width: 220px; color: var(--muted); font-weight: 500; font-size: 15px; }

.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 0; margin: 40px 0 28px; }
.steps li { counter-increment: s; border-top: 2px solid var(--line); padding-top: 16px; }
.steps li::before { content: "0" counter(s); font: 500 13px var(--mono); color: var(--accent); }
.steps h3 { margin: 6px 0 8px; }
.steps p { color: var(--muted); font-size: 15px; }
.note { color: var(--muted); font-size: 15px; border-left: 2px solid var(--accent); padding-left: 14px; }

h2 + details { margin-top: 32px; }
details { border-top: 1px solid var(--line); padding: 16px 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; color: var(--accent); font-family: var(--mono); }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin-top: 10px; }

form { display: grid; gap: 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: 16px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 11px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px 6px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
legend { padding: 0 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text); font-weight: 400; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
#form-status { min-height: 1.4em; font-size: 15px; }
#form-status.ok { color: var(--ok); }
#form-status.err { color: var(--error); }

footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.foot { display: grid; gap: 8px; }
.tm { max-width: 80ch; font-size: 13px; }

@media (max-width: 860px) {
  .hero { padding: 48px 0; }
  .hero-grid, .cap { grid-template-columns: 1fr; gap: 28px; }
  .cap pre { position: static; }
  .trio { grid-template-columns: 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr 1fr; }
  nav a:not(.btn) { display: none; }
  .section { padding: 64px 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .brand span { font-size: 15px; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 12px; }
  .row, fieldset, .steps { grid-template-columns: 1fr; }
  th, td { display: block; width: auto; padding: 4px 0; border: 0; }
  tr { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
  pre { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- content pages ---- */
.doc { padding: 56px 0 96px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 8px; color: var(--line); }
.doc h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); margin-bottom: 20px; }
.doc .lead { max-width: none; margin: 0 0 36px; }
.doc h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 48px 0 14px; }
.doc h3 { margin: 28px 0 8px; }
.doc p { color: #cdd3db; margin-bottom: 16px; }
.doc ul, .doc ol { color: #cdd3db; padding-left: 22px; margin: 0 0 16px; }
.doc li { margin-bottom: 8px; }
.doc pre { margin: 20px 0 24px; }
.doc table { margin: 20px 0 24px; }
.doc th { width: 200px; }
.callout { border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 6px 6px 0; padding: 14px 18px; margin: 24px 0; color: #cdd3db; }
.callout p:last-child { margin-bottom: 0; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; list-style: none; padding: 0; }
.related a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; background: var(--surface); }
.related a:hover { border-color: var(--accent); }
.related small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 2px; }
.cta-box { margin-top: 56px; padding: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.cta-box p { margin: 0; color: var(--text); font-weight: 600; max-width: 48ch; }
.cap-link { display: inline-block; margin-top: 12px; font-size: 15px; font-weight: 600; text-decoration: none; }
.cap-link:hover { text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 8px; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--text); }
@media (max-width: 560px) { .doc { padding: 36px 0 64px; } .doc th, .doc td { display: block; width: auto; } }
