/* Travixor Global developer docs. Same linen and olive palette and the same two fonts as the main site
   (tokens copied from src/site/site.css). Static: no framework, nothing moves except focus and hover colour. */

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/fonts/sora-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: oklch(97.8% 0.008 100);
  --paper-2: oklch(95.2% 0.011 104);
  --ink: oklch(23% 0.028 135);
  --ink-2: oklch(36% 0.03 135);
  --muted: oklch(49% 0.025 130);
  --rule: oklch(88% 0.014 110);
  --accent: oklch(43% 0.047 140);
  --accent-hi: oklch(37% 0.05 140);
  --accent-ink: oklch(98.5% 0.008 100);
  --sage: oklch(52% 0.08 135);
  --focus: oklch(52% 0.1 135);
  --deep: oklch(30% 0.04 138);
  --on-deep: oklch(96.5% 0.012 100);
  --on-deep-2: oklch(82% 0.03 125);

  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --head: 'Sora', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;

  --gutter: 48px;
  --bar: 64px;
}
@media (max-width: 60rem) { :root { --gutter: 24px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --bar: 56px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar) + 24px); scrollbar-color: var(--muted) var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
a { color: var(--accent); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); }
a:hover { color: var(--accent-hi); text-decoration-color: currentColor; }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 8px; z-index: 30; }
.skip:hover, .skip:focus { color: var(--paper); }
.skip:focus { top: 0.75rem; }

/* ------------------------------------------------------------------ top bar */

.bar { position: sticky; top: 0; z-index: 20; height: var(--bar); background: var(--paper); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { font-family: var(--head); font-size: 0.95rem; color: var(--muted); letter-spacing: -0.01em; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; white-space: nowrap; color: var(--ink-2); text-decoration: none; font-size: 0.97rem; border-radius: 8px; }
.top-nav a:hover { color: var(--ink); background: var(--paper-2); }
.top-nav a[aria-current] { color: var(--ink); font-weight: 600; }
.top-nav .apply { color: var(--accent-ink); background: var(--accent); font-weight: 500; margin-left: 8px; padding: 0 16px; }
.top-nav .apply:hover { background: var(--accent-hi); color: var(--accent-ink); }
@media (max-width: 40rem) {
  .brand span { display: none; }
  .top-nav a { padding: 0 9px; font-size: 0.92rem; }
  .top-nav .guides, .top-nav .apply .long { display: none; }
  .top-nav .apply { margin-left: 2px; padding: 0 14px; }
  .bar-in { gap: 12px; }
}

/* ------------------------------------------------------------------ layout */

.layout { max-width: 1240px; margin: 0 auto; padding: 56px var(--gutter) 96px; display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); column-gap: 72px; }
.side { position: sticky; top: calc(var(--bar) + 32px); align-self: start; max-height: calc(100vh - var(--bar) - 64px); overflow-y: auto; padding-bottom: 24px; }
.side h2, .menu h2 { font-family: var(--body); font-size: 0.9rem; font-weight: 600; color: var(--muted); margin: 28px 0 6px; letter-spacing: 0; line-height: 1.3; }
.side h2:first-child, .menu h2:first-of-type { margin-top: 0; }
.side a, .menu a { display: block; padding: 6px 0; min-height: 36px; color: var(--ink-2); text-decoration: none; font-size: 0.98rem; line-height: 1.35; }
.side a:hover, .menu a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.side a[aria-current], .menu a[aria-current] { color: var(--accent); font-weight: 600; }
.menu { display: none; margin-bottom: 36px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.menu summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ''; width: 8px; height: 8px; margin-left: 10px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.menu[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.menu nav { padding: 8px 0 16px; }
@media (max-width: 64rem) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 24px; }
  .side { display: none; }
  .menu { display: block; }
}

main { min-width: 0; max-width: 46rem; }

/* ------------------------------------------------------------------ text */

h1, h2, h3 { font-weight: 400; text-wrap: balance; overflow-wrap: break-word; margin: 0; }
h1 { font-family: var(--head); font-size: clamp(2.05rem, 1.3rem + 2.6vw, 3.1rem); line-height: 1.08; letter-spacing: -0.032em; }
h2 { font-family: var(--head); font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.75rem); line-height: 1.2; letter-spacing: -0.026em; margin-top: 64px; margin-bottom: 14px; }
h3 { font-family: var(--body); font-weight: 600; font-size: 1.08rem; line-height: 1.35; margin-top: 36px; margin-bottom: 8px; }
p, ul, ol, dl { margin: 0 0 1.1em; max-width: 68ch; }
.lead { font-size: 1.22rem; line-height: 1.55; color: var(--ink-2); margin-top: 20px; margin-bottom: 0; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 32px 0 0; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.button:hover { background: var(--accent-hi); color: var(--accent-ink); }
.text-link { min-height: 44px; display: inline-flex; align-items: center; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; padding-left: 0.2em; }
li::marker { color: var(--sage); }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-2); padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }
h1 code, h2 code, h3 code { font-size: 0.8em; }
.note { background: var(--paper-2); border-radius: 12px; padding: 16px 20px; margin: 28px 0; max-width: 68ch; }
.note p:last-child { margin-bottom: 0; }
.note code { background: color-mix(in oklab, var(--paper) 70%, var(--paper-2)); }
.steps { counter-reset: step; padding-left: 0; list-style: none; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1.1em; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0.05em; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--paper-2); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin: 20px 0 28px; max-width: 100%; }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 0.97rem; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; font-size: 0.9rem; color: var(--muted); padding: 0 16px 10px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { vertical-align: top; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--rule); min-width: 8rem; }
td:first-child { white-space: nowrap; min-width: 0; }
td:has(> code:only-child) { white-space: nowrap; }
td:has(> code:only-child) code { overflow-wrap: normal; }
td:last-child, th:last-child { padding-right: 0; }

.links { list-style: none; padding: 0; margin: 12px 0 0; }
.links li { padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.links li:last-child { border-bottom: 1px solid var(--rule); }
.links a { display: grid; gap: 2px; padding: 16px 0; text-decoration: none; color: var(--ink); }
.links a span { color: var(--ink-2); font-size: 0.98rem; }
.links a b { font-family: var(--head); font-weight: 400; font-size: 1.12rem; letter-spacing: -0.015em; }
.links a:hover b { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--rule); max-width: 68ch; }
.pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); min-height: 44px; }
.pager a small { color: var(--muted); font-size: 0.9rem; }
.pager a b { font-family: var(--head); font-weight: 400; font-size: 1.08rem; letter-spacing: -0.015em; }
.pager a:hover b { color: var(--accent); }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }

/* ------------------------------------------------------------------ code */

.code { margin: 22px 0 30px; max-width: 100%; }
.code-head { display: none; align-items: center; gap: 4px; margin-bottom: 8px; }
.code.js .code-head { display: flex; }
.tabs { display: flex; gap: 2px; }
.tabs button, .copy { font: inherit; font-size: 0.95rem; min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.tabs button { position: relative; }
.tabs button:hover, .copy:hover { color: var(--ink); background: var(--paper-2); }
.tabs button[aria-selected='true'] { color: var(--ink); font-weight: 600; }
.tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--accent); }
.copy { margin-left: auto; }
.code figure { margin: 0; }
.code figure + figure { margin-top: 20px; }
.code.js figure[hidden] { display: none; }
.code.js figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
figcaption { font-size: 0.92rem; color: var(--muted); margin-bottom: 6px; }
pre { margin: 0; background: var(--deep); color: var(--on-deep); border-radius: 14px; padding: 20px 24px; overflow-x: auto; font-family: var(--mono); font-size: 0.875rem; line-height: 1.65; tab-size: 2; scrollbar-color: var(--on-deep-2) var(--deep); max-width: 100%; }
pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; overflow-wrap: normal; }
pre ::selection { background: color-mix(in oklab, var(--on-deep) 28%, transparent); color: var(--on-deep); }
.cap { font-size: 0.92rem; color: var(--muted); margin: 8px 0 0; }
.out pre { background: var(--paper-2); color: var(--ink); scrollbar-color: var(--muted) var(--paper-2); }
.out pre ::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); color: var(--ink); }
.out figcaption { margin-bottom: 8px; }

/* ------------------------------------------------------------------ footer */

.foot { border-top: 1px solid var(--rule); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 32px var(--gutter) 40px; display: flex; flex-wrap: wrap; gap: 12px 32px; color: var(--muted); font-size: 0.95rem; }
.foot-in p { margin: 0; max-width: none; }
.foot-in a { color: var(--ink-2); }

/* ------------------------------------------------------------------ API reference page */

.ref-page { background: var(--paper); }
@media print { .bar, .side, .menu, .pager, .copy, .tabs { display: none; } pre { white-space: pre-wrap; } }

/* Very narrow phones (320 to 384 px). Last in the file so these win over the rules above. */
@media (max-width: 24rem) {
  .brand img { height: 22px; }
  .top-nav a { padding: 0 7px; font-size: 0.88rem; }
  .top-nav .apply { padding: 0 10px; margin-left: 0; }
  .bar-in { gap: 8px; }
  .tabs button { padding: 0 9px; font-size: 0.9rem; }
  .tabs button[aria-selected='true']::after { left: 9px; right: 9px; }
  .copy { padding: 0 8px; font-size: 0.9rem; }
}
