/* /docs portal in the research system (the same ground as /benchmarks, /research
   and the Bench): neutral white paper or #121212 at night, serif for reading
   headings, sans for UI, hairline rules, crayon art in the hero. No tinted
   blue-grey surfaces, no bloom field. Loaded after docs-explorer.css and
   unlayered, so these tokens are the ones the explorer reads. */
:root {
  color-scheme: light;
  --bg: #FFFFFF; --bg-alt: #FAFAFA; --bg-code: #FAFAFA; --art-bg: #FFFFFF;
  --ink: #262626; --ink-strong: #0A0A0A; --muted: #525252; --faint: #5C5C5C;
  --line: #E5E5E5; --line-soft: #EBEBEB; --edge: #D4D4D4;
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-soft: #EEF3FD;
  --code-ink: #262626; --chip: #F2F2F2; --row-hover: #F5F5F5;
  --m-get: #166b45;    --m-get-bg: #E9F4EE;
  --m-post: #1D4ED8;   --m-post-bg: #EEF3FD;
  --m-put: #8A5A0B;    --m-put-bg: #FBF2E2;
  --m-patch: #0B6E6E;  --m-patch-bg: #E3F3F3;
  --m-delete: #B42318; --m-delete-bg: #FBEAE8;
  --ok-ink: #166b45; --warn-ink: #7a5410;
  --sans: "Instrument Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Source Serif 4", "Tiempos Text", Georgia, serif;
  --serif: var(--display);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar-h: 60px;
}
:root[data-docs-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --bg-alt: #171717; --bg-code: #171717; --art-bg: #141414;
  --ink: #D4D4D4; --ink-strong: #FAFAFA; --muted: #A3A3A3; --faint: #9A9A9A;
  --line: #262626; --line-soft: #1F1F1F; --edge: #404040;
  --accent: #8AB4FF; --accent-hover: #A9C7FF; --accent-soft: #1A2333;
  --code-ink: #E5E5E5; --chip: #1F1F1F; --row-hover: #1B1B1B;
  --m-get: #86D3A6;    --m-get-bg: #14261C;
  --m-post: #8AB4FF;   --m-post-bg: #17233A;
  --m-put: #F3BF5E;    --m-put-bg: #2B2210;
  --m-patch: #7DD3D3;  --m-patch-bg: #112626;
  --m-delete: #F4A39A; --m-delete-bg: #2E1614;
  --ok-ink: #86D3A6; --warn-ink: #F3BF5E;
}

html, body { background: var(--bg); }
body { font-family: var(--sans); color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; letter-spacing: -.012em; color: var(--ink-strong); }

/* top bar: hairline, no tint */
.topbar { height: var(--topbar-h); background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--sans); font-weight: 600; color: var(--ink-strong); }
.brand em { color: var(--muted); border-left-color: var(--line); }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink-strong); }
.topbar-cta { border-color: var(--edge); }
.topbar-cta:hover { border-color: var(--ink-strong); color: var(--ink-strong) !important; }

/* hero: graph paper with the crayon art bleeding in from the left, text on the right */
.dx-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--art-bg); }
.dx-hero__art { position: absolute; inset: 0 auto 0 0; width: calc(50% + 160px); -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.dx-hero__art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.dx-hero__in { position: relative; max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 48px; min-height: clamp(400px, 36vw, 520px); }
.dx-hero__tx { grid-column: 2; align-self: center; padding-block: 56px; }
.dx-hero__eyebrow { margin: 0 0 14px; font: 500 14px/20px var(--sans); color: var(--muted); }
.dx-hero__title { margin: 0 0 18px; font: 400 clamp(40px, 4.4vw, 60px)/1.04 var(--display); letter-spacing: -.022em; color: var(--ink-strong); text-wrap: balance; }
.dx-hero__lede { margin: 0 0 26px; font: 400 18px/1.6 var(--display); color: var(--ink); max-width: 44ch; }
.dx-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.dx-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--edge); border-radius: 999px; background: var(--bg); color: var(--ink-strong); font: 500 15px/1 var(--sans); text-decoration: none; transition: background-color .15s ease, opacity .15s ease; }
.dx-pill:hover { background: var(--row-hover); }
.dx-pill--solid { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.dx-pill--solid:hover { background: var(--ink-strong); opacity: .86; }
/* The crayon lines are mid-grey; on the dark ground they need lifting to read as a drawing, not a smudge. */
:root[data-docs-theme="dark"] .dx-hero__art img { filter: brightness(1.7) contrast(1.1) drop-shadow(0 0 .6px rgba(255, 255, 255, .85)); }  /* the halo thickens the thin crayon lines */
@media (max-width: 900px) {
  .dx-hero__art { position: relative; width: auto; height: clamp(240px, 64vw, 440px); -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }
  /* Show the whole drawing on a phone instead of a cropped corner of empty grid. */
  .dx-hero__art img { object-fit: contain; object-position: 50% 50%; }
  .dx-hero__in { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; padding: 0 16px; }
  .dx-hero__tx { grid-column: 1; padding-block: 4px 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dx-hero__art img { animation: dx-draw 1.2s cubic-bezier(.65, 0, .35, 1) both; }
  @keyframes dx-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}

/* portal: guides and quickstarts */
.docs-portal { max-width: 1240px; margin: auto; padding: 40px 24px 64px; position: relative; background: var(--bg); color: var(--ink); }
.portal-tools { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.portal-tools label { flex: 1; min-width: 200px; font: 500 14px/20px var(--sans); color: var(--muted); }
.portal-tools kbd { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--edge); border-radius: 5px; font: 12px var(--mono); color: var(--faint); }
.portal-tools input { display: block; width: 100%; margin-top: 8px; min-height: 46px; padding: 0 14px; border: 1px solid var(--edge); background: var(--bg); color: var(--ink-strong); border-radius: 10px; font: 15px var(--sans); }
.portal-tools input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.portal-tools button, .quickstart-tabs button, .portal-copy { min-height: 44px; border: 1px solid var(--edge); background: var(--bg); color: var(--ink-strong); padding: 0 16px; border-radius: 999px; font: 500 14px var(--sans); }
.portal-tools button:hover, .portal-copy:hover, .quickstart-tabs button:hover { background: var(--row-hover); }
.quickstart-tabs button[aria-selected="true"] { background: var(--ink-strong); border-color: var(--ink-strong); color: var(--bg); }
.portal-nav { display: flex; gap: 6px 22px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--line); margin: 20px 0 8px; }
.portal-nav a { color: var(--muted); font: 500 15px/22px var(--sans); text-decoration: none; }
.portal-nav a:hover { color: var(--ink-strong); text-decoration: underline; text-underline-offset: 4px; }
.docs-portal section { scroll-margin-top: calc(var(--topbar-h) + 16px); padding: 8px 0 12px; }
.docs-portal section + section { margin-top: 36px; }
.docs-portal h1 { font-size: clamp(32px, 3.2vw, 42px); line-height: 1.1; margin: 20px 0 12px; }
.docs-portal h2 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.15; margin: 8px 0 12px; }
.docs-portal h3 { font-size: 21px; line-height: 1.25; margin: 0 0 10px; }
.docs-portal p, .docs-portal li { font-size: 16.5px; line-height: 1.65; color: var(--ink); max-width: 72ch; }
.docs-portal p a, .portal-card a, .docs-portal li a { color: var(--ink-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.docs-portal p a:hover, .portal-card a:hover, .docs-portal li a:hover { color: var(--accent); }
.docs-portal :not(pre) > code { padding: .1rem .35rem; border-radius: 5px; background: var(--chip); color: var(--ink-strong); font: .86em var(--mono); }
.portal-kicker { margin: 0; font: 500 14px/20px var(--sans); color: var(--muted); }
.portal-lead { max-width: 60ch; color: var(--ink); font: 400 19px/1.6 var(--display); }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 20px 0 28px; border-top: 1px solid var(--line); }
.portal-card { padding: 22px 24px 22px 0; border-bottom: 1px solid var(--line); background: none; border-radius: 0; }
.portal-card + .portal-card { padding-left: 24px; border-left: 1px solid var(--line); }
.portal-grid .portal-card:nth-child(3n+1) { padding-left: 0; border-left: 0; }
.portal-card p { color: var(--muted); margin: 0 0 12px; font-size: 15.5px; }
.quickstart-tabs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.quickstart-pane pre { background: var(--bg-code); color: var(--code-ink); padding: 20px 22px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quickstart-pane code { font-family: var(--mono); font-size: 13.5px; line-height: 1.65; }
.portal-copy { margin-top: 10px; }
.portal-result { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-strong); text-decoration: underline; text-underline-offset: 3px; }
.portal-search-results[hidden], .quickstart-pane[hidden] { display: none; }
.portal-search-results { padding: 16px 0; }
.portal-note { border-left: 2px solid var(--ink-strong); padding-left: 20px; color: var(--ink); }
@media (max-width: 760px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card, .portal-card + .portal-card { padding: 18px 0; border-left: 0; }
  .docs-portal { padding: 28px 16px 48px; }
  .portal-nav { gap: 4px 16px; }
}

/* reference explorer: the same paper, hairlines and type */
.layout { border-top: 1px solid var(--line); background: var(--bg); }
.sidebar { background: var(--bg); border-right-color: var(--line); }
.sidebar-search input, .sidebar-filters select, .language-control select { background-color: var(--bg); border-color: var(--edge); color: var(--ink-strong); }
.sidebar-search kbd { background: var(--bg); border-color: var(--edge); }
.operation-option:hover { background: var(--row-hover); }
.operation-option[aria-selected="true"] { background: var(--row-hover); box-shadow: inset 2px 0 0 var(--ink-strong); }
.reference-eyebrow { color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: .9rem; }
.reference-head h1 { font-family: var(--display); font-weight: 400; }
.method-badge { background: var(--chip); }
.reference-notes code { background: var(--chip); }
.sandbox-fixture-note { color: var(--warn-ink); }
.response-status strong { color: var(--ok-ink); }
.code-tabs button[aria-selected="true"] { background: var(--ink-strong); color: var(--bg); }
.copy-button:hover { border-color: var(--ink-strong); color: var(--ink-strong); }
.codepanel { background: var(--bg-alt); border-left: 1px solid var(--line); }
.site-footer { background: var(--bg); color: var(--muted); border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink-strong); }
:root[data-docs-theme="dark"] .param-optional { color: #A3A3A3; }
/* the closed mobile drawer sat 6px off-screen and its shadow bled a grey band down the left edge */
@media (max-width: 860px) { .sidebar { box-shadow: none; } .sidebar.is-open { box-shadow: 0 20px 60px rgb(0 0 0 / .18); } }
