/* ==========================================================================
   Queen MQ, static docs site
   Design tokens lifted from app/src/style.css to keep parity with dashboard.
   No build step. No JS framework. Pure HTML + this file + Prism.
   ========================================================================== */

:root {
  /* Surfaces, Cursor greys */
  --ink-0: #141415;  /* page bg */
  --ink-1: #1a1a1b;  /* nav / header */
  --ink-2: #1d1d1f;  /* card */
  --ink-3: #232325;  /* code, input */
  --ink-4: #252527;  /* hover */
  --ink-5: #2d2d30;  /* active */

  --text-hi:    #e6e6e6;
  --text-mid:   #9a9a9a;
  --text-low:   #6a6a6a;
  --text-faint: #464649;

  /* White-as-accent (Cursor "Accept button" vibe) */
  --accent:     #ffffff;
  --accent-dim: #d4d4d4;

  /* Brand glow */
  --ice-400: #22d3ee;
  --ice-glow: rgba(34, 211, 238, 0.10);
  --ember-400: #fb7185;
  --ember-glow: rgba(244, 63, 94, 0.10);
  --warn-400: #e6b450;
  --warn-glow: rgba(230, 180, 80, 0.10);
  --ok-500:  #4ade80;
  --ok-glow: rgba(74, 222, 128, 0.10);

  --bd:    #26262a;
  --bd-hi: #35353a;

  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink-0);
  color: var(--text-hi);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11","ss01","ss03","cv02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  line-height: 1.55;
  font-size: 14.5px;
}
::selection { background: rgba(255, 255, 255, 0.14); }
*:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
  border-radius: 4px;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2a2a2d;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #3a3a3e; background-clip: padding-box; }

a { color: var(--text-hi); text-decoration: none; transition: color .12s var(--ease); }
a:hover { color: var(--accent); }
a.subtle { color: var(--text-mid); }
a.subtle:hover { color: var(--text-hi); }

/* =========================================================================
   LAYOUT
   ========================================================================= */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.shell-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 20, 21, 0.78);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--bd);
}
.topnav-inner {
  display: flex; align-items: center; gap: 18px;
  height: 52px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.015em;
  color: var(--text-hi);
}
.brand-mark {
  width: 24px; height: 24px; border-radius: 6px; overflow: hidden;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  background: var(--ink-3);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand b {
  font-weight: 500; font-size: 10.5px;
  letter-spacing: 0.06em; color: var(--text-mid); margin-left: 3px;
}
.topnav-links {
  display: flex; align-items: center; gap: 4px; margin-left: 12px;
  flex: 1; min-width: 0; overflow-x: auto;
}
.topnav-links::-webkit-scrollbar { height: 0; }
.topnav-links a {
  display: inline-flex; align-items: center;
  padding: 6px 10px; border-radius: 5px;
  color: var(--text-mid); font-size: 12.5px; font-weight: 500;
  white-space: nowrap;
  transition: color .12s var(--ease), background .12s var(--ease);
}
.topnav-links a:hover { color: var(--text-hi); background: var(--ink-4); }
.topnav-links a.current { color: var(--text-hi); background: var(--ink-5); }
.topnav-right { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-link {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 5px; color: var(--text-mid);
  transition: color .12s, background .12s;
}
.icon-link:hover { color: var(--text-hi); background: var(--ink-4); }
.icon-link svg { width: 15px; height: 15px; }

@media (max-width: 640px) {
  .topnav-inner { padding: 0 14px; gap: 10px; }
  .brand b { display: none; }
  .topnav-links { gap: 0; }
  .topnav-links a { padding: 6px 7px; font-size: 12px; }
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero::before {
  /* subtle ice-cyan radial glow */
  content: "";
  position: absolute; inset: -200px -100px auto -100px; height: 540px;
  background:
    radial-gradient(60% 70% at 50% 0%,
      rgba(34, 211, 238, 0.10) 0%,
      rgba(34, 211, 238, 0.04) 30%,
      transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: 24px;
  text-align: left;
}
.hero h1 {
  font-size: clamp(34px, 5.5vw, 52px);
  font-weight: 600; line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text-hi);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--text-hi) 30%, var(--ice-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 17px; line-height: 1.55;
  color: var(--text-mid);
  max-width: 680px;
  margin: 0;
}
.hero-actions {
  display: inline-flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.hero-meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 14px;
  font-size: 12px; color: var(--text-low);
}
.hero-meta .dot {
  width: 4px; height: 4px; border-radius: 99px; background: var(--text-faint);
}
.hero-meta strong { color: var(--text-mid); font-weight: 500; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500; line-height: 1;
  border: 1px solid var(--bd-hi);
  color: var(--text-hi); background: rgba(255,255,255,.03);
  cursor: pointer; text-decoration: none;
  transition: .12s var(--ease);
}
.btn:hover { border-color: rgba(255,255,255,.22); color: var(--text-hi); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #000;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #000; }
.btn-ghost {
  background: transparent; border-color: transparent; color: var(--text-mid);
}
.btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text-hi); border-color: transparent; }
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* =========================================================================
   SECTIONS / TYPOGRAPHY
   ========================================================================= */
.section { padding: 56px 0; }
.section-tight { padding: 28px 0; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 14px; color: var(--text-hi); }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 10px; color: var(--text-hi); }
h4 { font-size: 13.5px; font-weight: 600; margin: 22px 0 8px; color: var(--text-hi); }
p { margin: 0 0 12px; }
.muted { color: var(--text-mid); }
.faint { color: var(--text-low); }
hr {
  border: none; border-top: 1px solid var(--bd);
  margin: 40px 0;
}
.label-xs {
  font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 500; color: var(--text-low);
}

/* Inline code */
:not(pre) > code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  padding: 1.5px 5px; border-radius: 3px;
  background: var(--ink-3); border: 1px solid var(--bd);
  color: var(--text-hi);
}

/* Lists */
ul, ol {
  padding-left: 22px;
  margin: 0 0 14px;
  color: var(--text-mid);
}
li { margin: 4px 0; }
li::marker { color: var(--text-faint); }
li > strong { color: var(--text-hi); font-weight: 500; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 14px 0;
}
table th {
  text-align: left; font-weight: 500; font-size: 10.5px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-low); padding: 8px 12px;
  border-bottom: 1px solid var(--bd);
}
table td {
  padding: 8px 12px; border-bottom: 1px solid var(--bd);
  color: var(--text-mid); vertical-align: top;
}
table tr:last-child td { border-bottom: 0; }
table td code, table th code { font-size: 12px; }

/* =========================================================================
   FEATURE CARDS / GRID
   ========================================================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 880px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .card-grid, .card-grid-2 { grid-template-columns: 1fr; }
}
.card {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 18px 20px;
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.card:hover { border-color: var(--bd-hi); }
.card a.card-cover { position: absolute; inset: 0; }
.card .card-eyebrow {
  font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 500;
  color: var(--ice-400);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.card h3 {
  margin: 0 0 6px; font-size: 14.5px; font-weight: 600;
  letter-spacing: -0.005em; color: var(--text-hi);
}
.card p { margin: 0; font-size: 13px; color: var(--text-mid); line-height: 1.5; }

/* Stat tiles (used on benchmarks/index) */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--ink-2); border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat .stat-label {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-low); font-weight: 500;
}
.stat .stat-value {
  display: block; margin-top: 6px;
  font-size: 22px; font-weight: 600; line-height: 1.15;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: var(--text-hi);
}
.stat .stat-value small {
  font-size: 12px; font-weight: 500; color: var(--text-mid); margin-left: 4px; letter-spacing: 0;
}
.stat .stat-foot {
  margin-top: 6px; font-size: 11.5px; color: var(--text-low);
}

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid transparent;
}
.chip .dot { width: 5px; height: 5px; border-radius: 99px; }
.chip-ice  { color: var(--ice-400);  background: var(--ice-glow);  border-color: rgba(34,211,238,.22); }
.chip-ice .dot { background: var(--ice-400); }
.chip-ok   { color: var(--ok-500);   background: var(--ok-glow);   border-color: rgba(74,222,128,.22); }
.chip-ok .dot { background: var(--ok-500); }
.chip-warn { color: var(--warn-400); background: var(--warn-glow); border-color: rgba(230,180,80,.22); }
.chip-warn .dot { background: var(--warn-400); }
.chip-mute { color: var(--text-mid); background: var(--ink-3); border-color: var(--bd); }
.chip-mute .dot { background: var(--text-low); }

/* kbd */
kbd {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; padding: 1px 5px; border-radius: 3px;
  background: var(--ink-4); border: 1px solid var(--bd);
  color: var(--text-mid);
}

/* =========================================================================
   CODE BLOCKS
   ========================================================================= */
pre {
  margin: 14px 0;
  background: var(--ink-3);
  border: 1px solid var(--bd);
  border-radius: 8px;
  overflow: auto;
  position: relative;
}
pre code {
  display: block;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; line-height: 1.6;
  color: #e6e6e6;
  background: transparent;
  border: none;
  tab-size: 2;
}
.code-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--bd);
  font-size: 11px; color: var(--text-low);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .04em;
}
.code-meta + pre {
  margin-top: 0;
  border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0;
}
.code-meta-wrap {
  border: 1px solid var(--bd); border-radius: 8px; overflow: hidden; margin: 14px 0;
}
.code-meta-wrap .code-meta { border-bottom: 1px solid var(--bd); }
.code-meta-wrap pre { margin: 0; border: 0; border-radius: 0; }
.copy-btn {
  background: transparent; border: 1px solid var(--bd);
  color: var(--text-mid); padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-family: inherit; cursor: pointer;
  transition: .12s;
}
.copy-btn:hover { color: var(--text-hi); border-color: var(--bd-hi); background: var(--ink-4); }
.copy-btn.copied { color: var(--ok-500); border-color: rgba(74,222,128,.4); }

/* Prism-style minimal token coloring (dark Cursor-ish palette) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--text-faint); font-style: italic; }
.token.punctuation { color: var(--text-mid); }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #e6b450; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #a3e635; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #67e8f9; }
.token.atrule, .token.attr-value, .token.keyword { color: #c4b5fd; }
.token.function, .token.class-name { color: #fb7185; }
.token.regex, .token.important, .token.variable { color: #fde68a; }
.token.important, .token.bold { font-weight: 600; }
.token.italic { font-style: italic; }

/* =========================================================================
   LANGUAGE TABS (CSS-only, radio-driven)
   ========================================================================= */
.tabs {
  border: 1px solid var(--bd); border-radius: 8px; overflow: hidden;
  background: var(--ink-2);
  margin: 14px 0;
}
.tabs input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tabs-bar {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--bd);
  background: var(--ink-1);
  overflow-x: auto;
}
.tabs-bar::-webkit-scrollbar { height: 0; }
.tabs-bar label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 12px; font-weight: 500; color: var(--text-mid);
  cursor: pointer; white-space: nowrap;
  border-right: 1px solid var(--bd);
  transition: color .12s, background .12s;
}
.tabs-bar label:hover { color: var(--text-hi); background: var(--ink-3); }
.tabs-bar label .lang-dot {
  width: 6px; height: 6px; border-radius: 99px; background: var(--text-low);
}
.tabs-panes > .tab-pane { display: none; padding: 0; }
.tabs-panes > .tab-pane > pre {
  margin: 0; border: 0; border-radius: 0; background: var(--ink-3);
}
.tabs-panes > .tab-pane > .pane-foot {
  padding: 8px 14px; border-top: 1px solid var(--bd);
  font-size: 11.5px; color: var(--text-low);
}
.tabs-panes > .tab-pane > .pane-foot code { font-size: 11.5px; }
/* checked state, selectors need to match the input ids/order */
.tabs input.t-js:checked       ~ .tabs-bar label[for$="-js"],
.tabs input.t-py:checked       ~ .tabs-bar label[for$="-py"],
.tabs input.t-go:checked       ~ .tabs-bar label[for$="-go"],
.tabs input.t-laravel:checked  ~ .tabs-bar label[for$="-laravel"],
.tabs input.t-cpp:checked      ~ .tabs-bar label[for$="-cpp"],
.tabs input.t-curl:checked     ~ .tabs-bar label[for$="-curl"] {
  color: var(--text-hi); background: var(--ink-3);
  box-shadow: inset 0 -1px 0 0 var(--ice-400);
}
.tabs input.t-js:checked       ~ .tabs-panes .pane-js,
.tabs input.t-py:checked       ~ .tabs-panes .pane-py,
.tabs input.t-go:checked       ~ .tabs-panes .pane-go,
.tabs input.t-laravel:checked  ~ .tabs-panes .pane-laravel,
.tabs input.t-cpp:checked      ~ .tabs-panes .pane-cpp,
.tabs input.t-curl:checked     ~ .tabs-panes .pane-curl {
  display: block;
}
/* color the dot per language */
.tabs-bar label[for$="-js"]      .lang-dot { background: #f7df1e; }
.tabs-bar label[for$="-py"]      .lang-dot { background: #4584b6; }
.tabs-bar label[for$="-go"]      .lang-dot { background: #00add8; }
.tabs-bar label[for$="-laravel"] .lang-dot { background: #ff2d20; }
.tabs-bar label[for$="-cpp"]     .lang-dot { background: #659ad2; }
.tabs-bar label[for$="-curl"]    .lang-dot { background: #9a9a9a; }

/* =========================================================================
   CALLOUTS
   ========================================================================= */
.callout {
  border-left: 2px solid var(--bd-hi);
  background: var(--ink-2);
  padding: 12px 14px; border-radius: 0 6px 6px 0;
  margin: 14px 0;
  font-size: 13.5px;
}
.callout-title {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 500; color: var(--text-low); margin-bottom: 6px;
}
.callout-info  { border-left-color: var(--ice-400); }
.callout-info  .callout-title { color: var(--ice-400); }
.callout-warn  { border-left-color: var(--warn-400); }
.callout-warn  .callout-title { color: var(--warn-400); }
.callout-bad   { border-left-color: var(--ember-400); }
.callout-bad   .callout-title { color: var(--ember-400); }
.callout-ok    { border-left-color: var(--ok-500); }
.callout-ok    .callout-title { color: var(--ok-500); }

.callout p:last-child { margin-bottom: 0; }

/* =========================================================================
   IN-PAGE SUB-NAV (page TOC)
   ========================================================================= */
.toc {
  margin: 16px 0 28px;
  padding: 0 0 12px;
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--bd);
}
.toc a {
  font-size: 12px; color: var(--text-mid);
  padding: 4px 9px; border-radius: 4px;
  transition: color .12s, background .12s;
}
.toc a:hover { color: var(--text-hi); background: var(--ink-3); }

/* =========================================================================
   API ENDPOINT
   ========================================================================= */
.endpoint {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  background: var(--ink-3); border: 1px solid var(--bd);
  border-radius: 6px; padding: 8px 12px;
  margin: 12px 0 8px;
  color: var(--text-hi);
}
.endpoint .method {
  display: inline-grid; place-items: center;
  min-width: 56px; padding: 2px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
}
.endpoint .method.get    { color: var(--ice-400);  background: var(--ice-glow);  border: 1px solid rgba(34,211,238,.25); }
.endpoint .method.post   { color: var(--ok-500);   background: var(--ok-glow);   border: 1px solid rgba(74,222,128,.25); }
.endpoint .method.delete { color: var(--ember-400); background: var(--ember-glow); border: 1px solid rgba(244,63,94,.28); }
.endpoint .method.put    { color: var(--warn-400); background: var(--warn-glow); border: 1px solid rgba(230,180,80,.25); }

/* =========================================================================
   ENV TABLE
   ========================================================================= */
.env-table th:first-child { width: 30%; }
.env-table td:first-child { font-family: 'JetBrains Mono', monospace; color: var(--text-hi); font-size: 12px; }
.env-table td:nth-child(2) { width: 18%; color: var(--text-low); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.env-table td:nth-child(3) { color: var(--text-mid); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-foot {
  margin-top: 80px; padding: 36px 0 48px;
  border-top: 1px solid var(--bd);
  font-size: 12.5px; color: var(--text-low);
}
.site-foot-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.site-foot h5 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  font-weight: 500; color: var(--text-mid); margin: 0 0 8px;
}
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 5px 0; }
.site-foot a { color: var(--text-mid); }
.site-foot a:hover { color: var(--text-hi); }
.site-foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--bd);
  flex-wrap: wrap; gap: 10px;
}
@media (max-width: 720px) {
  .site-foot-inner { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================
   Misc helpers
   ========================================================================= */
.anchor-pad { display: block; height: 0; padding-top: 64px; margin-top: -64px; visibility: hidden; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none; }
.center { text-align: center; }
img.bordered {
  display: block; max-width: 100%; height: auto;
  border-radius: 8px; border: 1px solid var(--bd);
}
img.bordered + figcaption {
  display: block; margin-top: 8px; font-size: 12px; color: var(--text-low); text-align: center;
}
figure { margin: 16px 0; }

.divider-thin { height: 1px; background: var(--bd); border: 0; margin: 28px 0; }
