/* Integrator guide (/api/docs/guida). Tokens, fonts, wordmark and header/footer follow apps/landing/src/index.html
   (the --code-* and --inline-code tokens are the guide's own):
   change them there first, then here. Fonts are copied next to this file at build time (no third-party requests). */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2-variations"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-italic.woff2") format("woff2-variations"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2-variations"); font-weight: 100 800; font-display: swap; }

:root {
  --paper: #EFF1F5;
  --surface: #FBFBFD;
  --ink: #10162B;
  --soft: #4A5270;
  --line: #D6DAE5;
  --accent: #2646D4;
  --accent-soft: #E1E6FB;
  --on-accent: #F7F8FF;
  --code-bg: #10162B;
  --code-fg: #DCE1F5;
  --code-dim: #8189A8;
  --inline-code: #E4E8F2;

  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 14px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --wrap: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1020; --surface: #141A2D; --ink: #E8EBF4; --soft: #A2A9C2; --line: #252D45;
    --accent: #8EA6FF; --accent-soft: #1C2550; --on-accent: #0C1020;
    --code-bg: #070A15; --code-fg: #DCE1F5; --code-dim: #737B9A; --inline-code: #1E2640;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C1020; --surface: #141A2D; --ink: #E8EBF4; --soft: #A2A9C2; --line: #252D45;
  --accent: #8EA6FF; --accent-soft: #1C2550; --on-accent: #0C1020;
  --code-bg: #070A15; --code-fg: #DCE1F5; --code-dim: #737B9A; --inline-code: #1E2640;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16.5px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 8px 14px; border-radius: var(--r-pill); }

/* buttons, nav, footer: as on the landing */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  height: 42px; padding-inline: 18px; border-radius: var(--r-pill);
  font: 600 15px/1 var(--f-body); text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 160ms var(--ease), border-color 200ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); }
.nav .wrap { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-size: 28px; }
.wordmark { display: block; height: 0.9em; width: auto; overflow: visible; }
.wordmark-letters { fill: currentColor; }
.wordmark-v { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.brand-tag { font: 500 12px/1 var(--f-mono); color: var(--soft); padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--soft); transition: color 150ms; }
.nav-links a:not(.btn):hover, .nav-links a[aria-current] { color: var(--ink); }
@media (max-width: 640px) {
  .brand-tag { display: none; }
  .nav-links { gap: 16px; }
  .nav-links .btn { display: none; }
}

footer { margin-top: 72px; padding-block: 36px; border-top: 1px solid var(--line); font-size: 14px; color: var(--soft); background: var(--surface); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; align-items: baseline; }
footer .brand { font-size: 24px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer nav a { text-decoration: none; }
footer nav a:hover { color: var(--ink); }
footer .footer-mail { color: var(--ink); text-decoration: none; font-weight: 500; }
footer .footer-mail:hover { color: var(--accent); }

/* two columns: page list, article */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); padding-top: 40px; align-items: start; }
.side { position: sticky; top: 92px; display: grid; gap: 20px; }
.pages { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: page; }
.pages > li > a {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: var(--soft); font-weight: 500; font-size: 15px;
  transition: background-color 150ms, color 150ms;
}
.pages > li > a::before { counter-increment: page; content: counter(page, decimal-leading-zero); font: 500 12px/1 var(--f-mono); color: var(--code-dim); }
.pages > li > a:hover { color: var(--ink); background: var(--surface); }
.pages > li > a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.pages > li > a[aria-current]::before { color: inherit; }
.toc { list-style: none; margin: 4px 0 10px; padding: 0 0 0 44px; display: grid; gap: 2px; font-size: 14px; }
.toc a { display: block; padding: 3px 0; color: var(--soft); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--accent); }
.side-ref { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-size: 14px; color: var(--soft); background: var(--surface); transition: border-color 150ms; }
.side-ref b { color: var(--ink); font-weight: 600; }
.side-ref b::after { content: " →"; color: var(--accent); }
.side-ref:hover { border-color: var(--accent); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 20px; }
  .side { position: static; display: block; min-width: 0; margin-inline: calc(-1 * clamp(16px, 4vw, 40px)); }
  /* the page list becomes one row that scrolls sideways; the header already links the API reference */
  .pages { display: flex; gap: 8px; overflow-x: auto; padding: 2px clamp(16px, 4vw, 40px) 6px; scrollbar-width: none; }
  .pages > li { flex: none; }
  .pages > li > a { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 8px 14px; background: var(--surface); }
  .pages > li > a[aria-current] { border-color: var(--accent-soft); }
  .toc, .side-ref { display: none; }
}

/* article */
.doc { min-width: 0; max-width: 78ch; }
.doc h1, .doc h2, .doc h3 { font-family: var(--f-display); font-stretch: 78%; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; line-height: 1.1; }
.doc h1 { font-size: clamp(40px, 5.4vw, 64px); font-stretch: 72%; font-weight: 750; letter-spacing: -0.01em; margin: 0 0 20px; }
.doc h1 + p { font-size: 18.5px; color: var(--soft); }
.doc h2 { font-size: clamp(26px, 3vw, 34px); margin: 56px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 22px; margin: 36px 0 10px; }
.doc .anchor { margin-left: 0.3em; color: var(--line); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity 150ms; }
.doc :is(h2, h3):hover .anchor, .doc .anchor:focus-visible { opacity: 1; color: var(--accent); }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--soft); }
.doc a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc strong { font-weight: 650; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc :not(pre) > code { font: 500 0.86em/1 var(--f-mono); background: var(--inline-code); padding: 0.18em 0.4em; border-radius: 6px; overflow-wrap: anywhere; font-variant-ligatures: none; }
.doc blockquote { margin: 24px 0; padding: 16px 20px; border-radius: var(--r); background: var(--accent-soft); }
.doc blockquote p:last-child { margin-bottom: 0; }

/* task lists (the go-live checklist) */
/* Normal text flow (not flex: that made every word and <code> its own column); the box sits in the left padding. */
.doc li:has(> input[type="checkbox"]) { list-style: none; position: relative; margin-left: -1.3em; padding-left: 30px; }
.doc li > input[type="checkbox"] {
  appearance: none; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; margin: 0;
  border: 1.5px solid color-mix(in oklab, var(--soft) 55%, transparent); border-radius: 5px; background: var(--surface);
}

/* tables scroll inside themselves on narrow screens */
.table-wrap { margin: 20px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; font-size: 13px; letter-spacing: 0.02em; color: var(--soft); background: color-mix(in oklab, var(--paper) 50%, var(--surface)); }
.doc tr:last-child td { border-bottom: 0; }
.doc td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .doc td:first-child { white-space: normal; } }

/* code blocks: the landing's dark card */
.code { margin: 20px 0 24px; background: var(--code-bg); color: var(--code-fg); border-radius: var(--r); overflow: hidden; }
.code-head { display: flex; justify-content: space-between; padding: 10px 18px; font: 500 12px/1.4 var(--f-mono); color: var(--code-dim); border-bottom: 1px solid color-mix(in oklab, var(--code-dim) 30%, transparent); }
.code pre { margin: 0; padding: 18px; overflow-x: auto; font: 400 13.5px/1.7 var(--f-mono); tab-size: 2; }
/* browsers give <code> their own monospace (Courier on macOS): inherit the pre's font instead */
.code pre code { font: inherit; font-variant-ligatures: none; } /* no ligatures in code meant to be copied: `=>` stays two characters */

/* previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; transition: border-color 150ms; }
.pager a:hover { border-color: var(--accent); }
.pager small { font-size: 13px; color: var(--soft); }
.pager b { font-weight: 600; }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }
