/* Tracera docs layout — shared by every /docs/* page.
   Two columns on desktop (sidebar + content), single column on mobile. */
:root {
  --green: #15553F;
  --green-deep: #0F4231;
  --lime: #CBF24D;
  --paper: #F6F3EC;
  --paper-2: #FAF8F2;
  --ink: #15130E;
  --ink-soft: #3A372F;
  --ink-mute: #9A958A;
  --line: #E6E1D6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- nav ---- */
.docs-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.docs-nav__in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.docs-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--green);
  text-decoration: none;
}
.docs-nav__brand svg { width: 30px; height: 30px; }
.docs-nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
}
.docs-nav__links a { color: var(--ink-soft); text-decoration: none; transition: color 0.15s; }
.docs-nav__links a:hover, .docs-nav__links a.active { color: var(--green); }
.docs-nav__cta {
  background: var(--green);
  color: var(--paper) !important;
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 13px;
}
.docs-nav__cta:hover { background: var(--lime); color: var(--green) !important; }
.docs-burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.docs-burger svg { width: 22px; height: 22px; }

/* ---- layout ---- */
.docs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 22px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
}

/* ---- sidebar ---- */
.docs-side {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-side__section {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 18px 10px 8px;
}
.docs-side__link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.12s, color 0.12s;
}
.docs-side__link:hover { background: rgba(21, 85, 63, 0.06); color: var(--green); }
.docs-side__link.active {
  background: var(--green);
  color: var(--paper);
  font-weight: 600;
}

/* ---- content ---- */
.docs-main { min-width: 0; }
.docs-main .eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.docs-main h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.docs-main .lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 32px;
  max-width: 64ch;
}
.docs-main h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.18;
  margin: 48px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.docs-main h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.docs-main h3 {
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 28px 0 8px;
}
.docs-main p { margin: 0 0 14px; }
.docs-main ul, .docs-main ol { margin: 0 0 16px; padding-left: 22px; }
.docs-main li { margin-bottom: 6px; }
.docs-main a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.docs-main strong { font-weight: 700; }

.docs-main code:not(pre code) {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  background: rgba(21, 85, 63, 0.08);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 4px;
}
.docs-main pre {
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 22px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.docs-main pre code { color: inherit; background: none; padding: 0; font-size: inherit; }
.docs-main pre .c { color: #9A958A; } /* comment */
.docs-main pre .k { color: #CBF24D; } /* keyword */
.docs-main pre .s { color: #F6E08A; } /* string */
.docs-main pre .n { color: #7BB7A0; } /* number/property */

.docs-main blockquote {
  border-left: 3px solid var(--lime);
  padding: 6px 18px;
  margin: 0 0 22px;
  background: rgba(203, 242, 77, 0.12);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--ink-soft);
}

.docs-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.docs-main th, .docs-main td {
  text-align: left;
  padding: 10px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.docs-main th {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--paper-2);
}
.docs-main td.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }

.docs-main .note,
.docs-main .warn,
.docs-main .good {
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  border-left: 4px solid var(--green);
  background: rgba(21, 85, 63, 0.05);
}
.docs-main .warn {
  border-left-color: #E08A3C;
  background: rgba(224, 138, 60, 0.07);
}
.docs-main .good {
  border-left-color: var(--lime);
  background: rgba(203, 242, 77, 0.14);
}

.docs-pager {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.docs-pager a {
  flex: 1 1 240px;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.15s;
}
.docs-pager a:hover { border-color: var(--green); transform: translateY(-1px); }
.docs-pager .pager-dir {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.docs-pager .pager-title { font-weight: 600; font-size: 15px; }
.docs-pager .pager-next { text-align: right; }

/* ---- footer ---- */
.docs-foot {
  border-top: 1px solid var(--line);
  padding: 32px 22px 56px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-mute);
}
.docs-foot__links { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.docs-foot__links a { color: var(--ink-mute); text-decoration: none; }
.docs-foot__links a:hover { color: var(--green); }
.docs-foot__copy {
  flex-basis: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ---- mobile ---- */
@media (max-width: 880px) {
  .docs { grid-template-columns: 1fr; gap: 22px; padding: 22px 18px 60px; }
  .docs-side {
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86vw;
    max-width: 320px;
    max-height: none;
    background: var(--paper);
    padding: 80px 18px 32px;
    border-right: 1px solid var(--line);
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
    box-shadow: 14px 0 36px -16px rgba(15, 66, 49, 0.25);
  }
  body.docs-open .docs-side { transform: translateX(0); }
  body.docs-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 66, 49, 0.45);
    backdrop-filter: blur(4px);
  }
  .docs-burger { display: inline-flex; align-items: center; justify-content: center; }
  .docs-nav__links a:not(.docs-nav__cta) { display: none; }
  .docs-nav__links { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .docs-side { transition: none; }
  html { scroll-behavior: auto; }
}
