/* Fonts are served from this site (SIL Open Font License, see site/fonts/OFL-*.txt): no third-party requests. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url(/site/fonts/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url(/site/fonts/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fragment Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/site/fonts/fragment-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fragment Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/site/fonts/fragment-mono-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* JDogo site: shared tokens and components for the website, the docs and the benchmarks page.
   Palette: cool paper + ink, marigold "highlighter" for JDogo (taken from tokenizer views),
   cobalt for anything you can click, redline for bytes JSON wastes. */

:root {
  --paper: #f4f6f9;
  --surface: #ffffff;
  --sunk: #eaeef4;
  --ink: #151a28;
  --ink-2: #4a5168;
  --ink-3: #5d6479;  /* 4.5:1 or better on every light background, including highlighted rows */
  --line: #dce1ea;
  --line-2: #c8cfdc;
  --mark: #f5b700;
  --mark-soft: #ffe48a;
  --mark-ink: #3d2c00;
  --cobalt: #2e44d6;
  --cobalt-soft: #dfe4ff;
  --waste: #a8302b;  /* 5.2:1 even on --waste-soft */
  --waste-soft: #fbdcda;
  --ok: #136a45;  /* 5.2:1 on the highlighted rows too */
  --tok-a: #ffe48a;
  --tok-b: #d3d9ff;
  --code-bg: #fbfcfe;
  --shadow: 0 1px 0 rgba(21, 26, 40, .04), 0 8px 24px -12px rgba(21, 26, 40, .18);

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10131c; --surface: #171b27; --sunk: #0c0f16; --ink: #eef1f7; --ink-2: #b3b9ca; --ink-3: #868da2;
    --line: #262c3c; --line-2: #343b4f; --mark: #ffc933; --mark-soft: #4d3d0d; --mark-ink: #ffe9a8;
    --cobalt: #8f9dff; --cobalt-soft: #222a58; --waste: #ff7a70; --waste-soft: #47201f; --ok: #4fd39a;
    --tok-a: #5a4710; --tok-b: #2b3466; --code-bg: #131722; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10131c; --surface: #171b27; --sunk: #0c0f16; --ink: #eef1f7; --ink-2: #b3b9ca; --ink-3: #868da2;
  --line: #262c3c; --line-2: #343b4f; --mark: #ffc933; --mark-soft: #4d3d0d; --mark-ink: #ffe9a8;
  --cobalt: #8f9dff; --cobalt-soft: #222a58; --waste: #ff7a70; --waste-soft: #47201f; --ok: #4fd39a;
  --tok-a: #5a4710; --tok-b: #2b3466; --code-bg: #131722; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--sans); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--mark-soft); color: var(--ink); }
code, pre, kbd, samp { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: var(--sunk); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--ink); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15.5px; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 820px) {
  .topbar .wrap { gap: 12px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; gap: 0;
         background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 14px; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: var(--r-sm); font-size: 17px; }
  .menu-btn { display: inline-grid; }
  .topbar-end .btn { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--ink); --f: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--b);
  background: var(--b); color: var(--f); font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14.5px; }
.btn.mark { --b: var(--mark); --f: #1b1400; }
.btn.line { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.line:hover { border-color: var(--ink-3); }

/* ---------- install strip ---------- */
.install {
  display: inline-flex; align-items: stretch; max-width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); overflow: hidden;
}
.install-tabs { display: flex; border-right: 1px solid var(--line); }
.install-tabs button {
  border: 0; background: transparent; color: var(--ink-3); font: 500 14px/1 var(--sans); padding: 0 12px; cursor: pointer;
}
.install-tabs button[aria-selected="true"] { color: var(--ink); background: var(--sunk); }
.install code { display: flex; align-items: center; padding: 12px 14px; background: none; font-size: 14px; white-space: nowrap; overflow-x: auto; min-width: 0; }
.install .copy { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink-2); padding: 0 14px; cursor: pointer; font: 500 14px var(--sans); }
.install .copy:hover { color: var(--ink); background: var(--sunk); }

/* ---------- code blocks ---------- */
.code {
  position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-md);
  margin: 0; overflow: hidden;
}
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; color: var(--ink); tab-size: 2; }
.code .code-copy {
  position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-sm); font: 500 12.5px var(--sans); padding: 5px 9px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.code:hover .code-copy, .code .code-copy:focus-visible { opacity: 1; }
@media (hover: none) { .code .code-copy { opacity: 1; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 6px; background: var(--surface); overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; font: 500 14px var(--sans); color: var(--ink-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--mark); }
.tabbed { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--code-bg); }
.tabbed .code { border: 0; border-radius: 0; }
.tabbed [role="tabpanel"][hidden] { display: none; }

/* syntax tints used by the hand-marked samples */
.k { color: var(--waste); }
.h { background: var(--mark-soft); color: var(--mark-ink); border-radius: 3px; box-shadow: 0 0 0 2px var(--mark-soft); }
.c { color: var(--ink-3); }
.s { color: var(--ok); }
.n { color: var(--cobalt); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 56px; color: var(--ink-3); font-size: 15px; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer p a, .footer .fine a { text-decoration: underline; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer .fine { max-width: 34ch; margin-top: 10px; }
@media (max-width: 760px) { .footer .wrap { grid-template-columns: 1fr 1fr; } .footer .wrap > :first-child { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* syntax colours, shared by the playground and the docs (hl.js) */
.h-at, .h-name { color: var(--ink); font-weight: 600; }
.h-form { background: var(--mark-soft); color: var(--mark-ink); border-radius: 2px; }
.h-dir { color: var(--ink-3); font-style: italic; }
.h-num { color: var(--cobalt); }
.h-kw { color: var(--cobalt); font-weight: 500; }
.h-str { color: var(--ok); }
.h-key { color: var(--waste); }
.h-null { color: var(--waste); font-weight: 600; }
.h-rep { color: var(--mark-ink); background: var(--mark-soft); border-radius: 2px; font-weight: 600; }
.h-p { color: var(--ink-3); }
