/* token.gme-ai.com/docs — v2 (2026-10-10): the homepage's design language (night header + hero, brand gradient,
   Inter, dark code panels) over the same markup and the same docs.js. The site's CSP allows same-origin styles only.
   Motion is decoration: the hero rises in, sections reveal on scroll where the browser supports scroll-driven
   animation, and everything stops under prefers-reduced-motion. */
@font-face { font-family: 'Inter'; src: url('/fonts/InterVariable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #fbf9f7; --surface: #ffffff; --surface-2: #f4f1ee; --surface-3: #ece7e1;
  --ink: #17121c; --ink-2: #4b4453; --ink-3: #7a7282; --line: #e9e4ee; --line-2: #ddd5e5;
  --orange: #ff8a3d; --pink: #e9338e; --violet: #8b5cf6; --brand: #e2552a;
  --grad: linear-gradient(100deg, var(--orange), var(--pink) 55%, var(--violet));
  --night: #120a1f; --night-2: #1b1030; --night-ink: #f5f1fa; --night-ink-2: #b9aecb; --night-line: rgba(255,255,255,.1);
  --code-bg: #150d22; --code-line: #2a1f3d; --code-ink: #e9e2f3; --code-dim: #a89bbd;
  --info: #2563eb; --info-soft: #eef4ff; --success: #15803d; --success-soft: #ecfdf3; --warn: #b45309; --warn-soft: #fff7ed; --danger: #dc2626; --danger-soft: #fef2f2;
  --tok-str: #fdba74; --tok-num: #fca5a5; --tok-key: #c4b5fd; --tok-kw: #f9a8d4; --tok-com: #8b7fa3; --tok-punc: #a89bbd;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.2,1);
  --hdr-h: 64px;
  --shadow: 0 1px 2px rgba(23,18,28,.05), 0 12px 32px -18px rgba(23,18,28,.25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0a14; --surface: #1a1324; --surface-2: #150f1d; --surface-3: #241a31; --ink: #f3eff8; --ink-2: #c3b9d1; --ink-3: #908aa0;
    --line: #2a2136; --line-2: #3a2e4a; --info: #93b4ff; --info-soft: rgba(59,130,246,.12); --success: #86efac; --success-soft: rgba(34,197,94,.12);
    --warn: #fcd34d; --warn-soft: rgba(245,158,11,.12); --danger: #fca5a5; --danger-soft: rgba(239,68,68,.12); --shadow: 0 16px 40px -20px rgba(0,0,0,.7); color-scheme: dark; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15.5px/1.65 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-feature-settings: 'cv11', 'ss01'; overflow-x: hidden; }
:target, [id] { scroll-margin-top: calc(var(--hdr-h) + 20px); }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
.sprite { display: none; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 16px; top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; display: block; stroke-width: 1.7; }
.ic-sm { width: 15px; height: 15px; stroke-width: 1.8; }

/* ── Header (night, like the homepage) ── */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px; padding: 0 max(24px, calc((100vw - 1440px) / 2 + 32px)); height: var(--hdr-h);
  background: color-mix(in srgb, var(--night) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--night-line); color: var(--night-ink); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 6px 18px -6px rgba(233,51,142,.6); }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-host { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--night-ink-2); }
.topbar-spacer { flex: 1 1 auto; }
.topbar-nav { display: flex; align-items: center; gap: 4px; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--night-ink-2); transition: color .2s, background .2s; }
.topbar-link:hover, .topbar-link[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar-cta { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; height: 36px; padding: 0 16px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 14px; background: var(--grad); background-size: 160% 100%; box-shadow: 0 8px 22px -10px rgba(233,51,142,.8); transition: background-position .5s var(--ease), transform .2s var(--ease); }
.topbar-cta:hover { text-decoration: none; background-position: 100% 0; transform: translateY(-1px); }
.topbar-cta .ic { width: 15px; height: 15px; }

/* ── Hero band ── */
.dochero { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: var(--night-ink); padding: 54px 0 46px; }
.dochero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.dochero-bg span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.dochero-bg .o1 { width: 520px; height: 520px; left: -140px; top: -260px; background: radial-gradient(circle, var(--orange), transparent 65%); animation: drift-a 18s ease-in-out infinite alternate; }
.dochero-bg .o2 { width: 560px; height: 560px; right: -180px; top: -200px; background: radial-gradient(circle, var(--violet), transparent 65%); animation: drift-b 22s ease-in-out infinite alternate; }
.dochero-bg .grid { inset: 0; border-radius: 0; filter: none; opacity: 1; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 75%); }
@keyframes drift-a { to { transform: translate3d(110px, 70px, 0) scale(1.1); } }
@keyframes drift-b { to { transform: translate3d(-100px, 110px, 0) scale(1.08); } }
.dochero-in { max-width: 1440px; margin: 0 auto; padding: 0 32px; }
.dochero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ffd9c4; background: rgba(255,138,61,.12); border: 1px solid rgba(255,138,61,.3); animation: rise .7s var(--ease) both; }
.dochero h1 { margin: 16px 0 12px; font-size: clamp(34px, 4.6vw, 54px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; animation: rise .8s var(--ease) .1s both; }
.dochero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dochero p { max-width: 720px; font-size: 17px; color: var(--night-ink-2); animation: rise .8s var(--ease) .2s both; }
.dochero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; animation: rise .8s var(--ease) .3s both; }
.dchip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--night-ink); background: rgba(255,255,255,.06); border: 1px solid var(--night-line); }
.dchip code { font-family: var(--mono); font-size: 13px; color: #fdba74; background: none; border: 0; padding: 0; }
.dchip .ic { width: 16px; height: 16px; color: #ffb38a; }
.dchip button { display: grid; place-items: center; width: 26px; height: 26px; margin-right: -6px; border-radius: 8px; color: var(--night-ink-2); transition: background .2s, color .2s; }
.dchip button:hover { background: rgba(255,255,255,.1); color: #fff; }
.dchip button[data-copied="1"] { color: #86efac; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; max-width: 1440px; margin: 0 auto; padding: 36px 32px 96px; }
.docnav { min-width: 0; }
.docnav-inner { position: sticky; top: calc(var(--hdr-h) + 20px); max-height: calc(100vh - var(--hdr-h) - 40px); overflow-y: auto; padding: 4px 8px 4px 0; scrollbar-width: thin; }
.docnav-title { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 18px 12px 6px; }
.docnav-title:first-child { padding-top: 0; }
.docnav-list { list-style: none; display: grid; gap: 2px; }
.docnav-link { position: relative; display: block; padding: 7px 12px; border-radius: 10px; font-size: 14.5px; color: var(--ink-2); transition: color .2s, background .2s, padding .25s var(--ease); }
.docnav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.docnav-link[aria-current="true"] { color: var(--ink); background: var(--surface); font-weight: 650; padding-left: 18px; box-shadow: var(--shadow); }
.docnav-link[aria-current="true"]::before { content: ''; position: absolute; left: 7px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); animation: grow-y .3s var(--ease); }
@keyframes grow-y { from { transform: scaleY(0); } }

.prose { min-width: 0; }
.prose:focus { outline: none; }
.sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); column-gap: 36px; align-items: start; padding-bottom: 56px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.sec:last-of-type { border-bottom: 0; }
.sec-body { min-width: 0; display: grid; gap: 16px; align-content: start; }
.sec-code { min-width: 0; position: sticky; top: calc(var(--hdr-h) + 20px); display: grid; gap: 14px; max-height: calc(100vh - var(--hdr-h) - 40px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.page-title { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.lede { font-size: 16.5px; color: var(--ink-2); max-width: 64ch; }
.sec h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.sec h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin-top: 8px; }
.sec h2.h-sub { font-size: 20px; margin-top: 8px; }
.sec p { color: var(--ink-2); max-width: 68ch; }
.sec p strong, .sec li strong { color: var(--ink); font-weight: 650; }
.sec p.tnote { font-size: 13.5px; color: var(--ink-3); }

.bullets { list-style: none; display: grid; gap: 10px; max-width: 68ch; }
.bullets > li { position: relative; padding-left: 22px; color: var(--ink-2); }
.bullets > li::before { content: ''; position: absolute; left: 6px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
ol.bullets { counter-reset: b; }
ol.bullets > li::before { content: counter(b) '.'; counter-increment: b; left: 0; top: 0; width: auto; height: auto; border-radius: 0; background: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 20px; max-width: 68ch; }
.steps > li { counter-increment: s; position: relative; padding-left: 46px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; background: var(--grad); box-shadow: 0 8px 18px -10px rgba(233,51,142,.8); }
.steps h3 { font-size: 16px; margin: 2px 0 6px; }

.endpoint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-width: none !important; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.endpoint:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.method { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; border: 1px solid transparent; font-family: var(--mono); }
.method-get { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.method-post { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.path { font-family: var(--mono); font-size: 14px; color: var(--ink); word-break: break-all; }
.mi, .sec td code, .sec th code, .kv code, .sec p code, .sec li code { font-family: var(--mono); font-size: .86em; background: color-mix(in srgb, var(--violet) 9%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 18%, transparent); border-radius: 6px; padding: 1px 6px; color: var(--ink); word-break: break-word; }
.kv { display: grid; gap: 12px; max-width: 68ch; }
.kv dt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 14px; color: var(--ink); }
.kv dd { color: var(--ink-2); font-size: 14.5px; padding-left: 12px; border-left: 2px solid var(--line-2); }
.note { display: flex; gap: 12px; padding: 14px 16px; background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); border-radius: 12px; }
.note .ic { color: var(--info); margin-top: 3px; }
.note p { color: var(--ink); font-size: 14.5px; max-width: none; }
.note p + p { margin-top: 10px; }
.note-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.note-warn .ic { color: var(--warn); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.params { font-size: 14px; min-width: 440px; }
.params th, .params td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.params thead th { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
.params tbody tr { transition: background .15s; }
.params tbody tr:hover { background: var(--surface-2); }
.params tbody tr:last-child td { border-bottom: 0; }
.params td { color: var(--ink-2); }
.params td:first-child { color: var(--ink); white-space: nowrap; }
.params td code { white-space: nowrap; }
.req, .opt { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.req { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.opt { background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line-2); }

/* ── Code panels (dark, like the homepage) ── */
.code { border: 1px solid var(--code-line); border-radius: 14px; background: var(--code-bg); overflow: hidden; box-shadow: 0 24px 48px -28px rgba(18,10,31,.8); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.code:hover { transform: translateY(-2px); box-shadow: 0 30px 56px -28px rgba(18,10,31,.9); }
.code-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--code-line); min-height: 38px; }
.code-head::before { content: ''; flex: none; width: 38px; height: 10px; background: radial-gradient(circle at 5px 5px, #ff5f57 4.5px, transparent 5px), radial-gradient(circle at 19px 5px, #febc2e 4.5px, transparent 5px), radial-gradient(circle at 33px 5px, #28c840 4.5px, transparent 5px); opacity: .9; }
.code-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--code-dim); }
.copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--code-line); border-radius: 8px; color: var(--code-dim); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; transition: color .2s, border-color .2s, background .2s; }
.copy:hover { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.06); }
.copy[data-copied="1"] { color: #86efac; border-color: rgba(134,239,172,.45); animation: pop .3s var(--ease); }
@keyframes pop { 50% { transform: scale(1.08); } }
.copy .ic { width: 13px; height: 13px; }
.code-body { margin: 0; padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--code-ink); tab-size: 2; }
.code-body code { font: inherit; white-space: pre; display: block; }
.t-str { color: var(--tok-str); } .t-num { color: var(--tok-num); } .t-key { color: var(--tok-key); } .t-kw { color: var(--tok-kw); } .t-com { color: var(--tok-com); font-style: italic; } .t-punc { color: var(--tok-punc); }
.tabset { display: grid; gap: 14px; }
.tabset[data-enhanced="1"] { gap: 0; }
.tabset[data-enhanced="1"] > .code { border-top-left-radius: 0; border-top-right-radius: 0; }
.tablist { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 6px 0; background: #1b1129; border: 1px solid var(--code-line); border-bottom: 0; border-radius: 14px 14px 0 0; }
.tab-btn { padding: 7px 14px; border-radius: 9px 9px 0 0; font-size: 13.5px; font-weight: 600; color: var(--code-dim); border-bottom: 2px solid transparent; transition: color .2s, background .2s; }
.tab-btn:hover { color: #fff; }
.tab-btn[aria-selected="true"] { color: #fff; background: var(--code-bg); border-bottom-color: var(--pink); }

.docfoot { padding-top: 24px; }
.docfoot p { font-size: 13.5px; color: var(--ink-3); max-width: 68ch; }

/* ── Scroll reveal: CSS scroll-driven animation, so content is never hidden where it is unsupported ── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sec { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .sec { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .sec-code { position: static; max-height: none; overflow-y: visible; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 20px 72px; }
  .docnav-inner { position: static; max-height: none; overflow-y: visible; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
  .docnav-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .topbar { padding: 0 20px; gap: 12px; }
  .dochero-in { padding: 0 20px; }
}
@media (max-width: 720px) {
  .topbar-nav .topbar-link.hide-sm { display: none; }
}
@media (max-width: 560px) {
  .layout { padding: 18px 14px 64px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .brand-host { display: none; }
  .topbar-link { padding: 7px 9px; font-size: 13.5px; }
  .topbar-cta { padding: 0 12px; }
  .dochero { padding: 38px 0 32px; }
  .dochero-in { padding: 0 14px; }
  .dochero p { font-size: 15.5px; }
  .sec { padding-bottom: 36px; margin-bottom: 28px; }
  .docnav-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .copy { min-height: 32px; }
  .tab-btn { min-height: 40px; }
  .code-body { padding: 12px; font-size: 12.5px; }
  .params { min-width: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .docnav, .skip, .copy, .dochero-bg { display: none; }
  .dochero { background: none; color: var(--ink); padding: 0 0 16px; }
  .layout { grid-template-columns: 1fr; }
  .sec { grid-template-columns: 1fr; break-inside: avoid; }
  .sec-code { position: static; max-height: none; }
}

/* Grid children may shrink below their content, and a bare <pre> scrolls inside itself instead of widening the page. */
.sec-body > *, .sec-code > * { min-width: 0; }
.sec pre:not(.code-body) { overflow-x: auto; max-width: 100%; margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); font-family: var(--mono); font-size: 13px; line-height: 1.65; }
.brand-name, .topbar-link, .topbar-cta { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar-link[aria-current="page"] { display: none; }   /* you are on Docs already; room for the rest */
  .topbar-cta { font-size: 13px; padding: 0 11px; margin-left: 2px; }
}
@media (max-width: 350px) {
  .topbar-link { display: none; }
}
