/* Engine guide pages (/docs/*). Tokens, nav, footer, wordmark, .gtag come from
   /styles.css; this adds the docs layout, code blocks, callouts, and pickers. */

.docs-page {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg);
}
.docs-main { position: relative; z-index: 1; }

/* Long-form: keep the fixed nav legible over scrolling text (matches /nulltick). */
.docs-page .nav { mix-blend-mode: normal; background: linear-gradient(180deg, rgba(8,8,10,0.94) 0%, rgba(8,8,10,0.7) 62%, rgba(8,8,10,0) 100%); }

.docs-page code { font-family: var(--mono); font-size: 0.88em; color: #e8e6de; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }

/* ---------- Shared wrap ---------- */
.docs-wrap { max-width: 1180px; margin: 0 auto; width: 100%; padding: 0 clamp(22px, 5vw, 64px); }

/* ---------- Landing (/docs) ---------- */
.docs-lander { padding: 150px 0 90px; }
.docs-lander .index { display: inline-block; }
.docs-lander h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.0; letter-spacing: -0.03em; margin: 18px 0 22px; text-wrap: balance; }
.docs-lander .lede { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: #dcdad2; max-width: 60ch; line-height: 1.6; }
.docs-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 46px; max-width: 1000px; }
.docs-pick-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: rgba(10,10,12,0.5); padding: 24px 22px 22px; text-decoration: none; color: inherit; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.docs-pick-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.24); background: rgba(16,16,19,0.62); }
.docs-pick-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); margin-bottom: 16px; }
.docs-pick-mark img, .docs-pick-mark svg { width: 26px; height: 26px; display: block; }
.docs-pick-card:hover .docs-pick-mark { color: var(--accent); border-color: rgba(47,152,179,0.4); }
.docs-pick-name { font-size: 1.15rem; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.docs-pick-sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; flex: 1; }
.docs-pick-meta { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.docs-pick-go { margin-left: auto; color: var(--accent); font-size: 13px; font-weight: 600; }
.docs-pick-card:hover .docs-pick-go::after { content: " →"; }

/* ---------- Guide page: engine switcher (3 shortcuts, above the hero) ---------- */
.doc-switch { padding-top: 116px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.doc-switch-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-right: 6px; }
.doc-switch-tab { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 7px 15px; border: 1px solid var(--line); border-radius: 999px; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.doc-switch-tab img, .doc-switch-tab svg { width: 15px; height: 15px; display: block; opacity: 0.85; }
.doc-switch-tab:hover { color: var(--fg); border-color: rgba(255,255,255,0.3); }
.doc-switch-tab.is-active { color: var(--accent); border-color: rgba(47,152,179,0.5); background: rgba(47,152,179,0.08); }

/* ---------- Guide page: hero ---------- */
.doc-hero { padding: 22px 0 30px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.doc-hero-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
.doc-dl, .doc-dash { display: inline-flex; align-items: center; gap: 9px; border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 600; text-decoration: none; transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease; }
.doc-dl { background: #f3f1ea; color: #0a0b0d; }
.doc-dl:hover { transform: translateY(-2px); }
.doc-dl-ver { font-family: var(--mono); font-size: 11px; font-weight: 500; opacity: 0.7; }
.doc-dl.is-soon { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--line); cursor: default; }
.doc-dl.is-soon:hover { transform: none; }
.doc-dl-soon { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.doc-dash { border: 1px solid var(--line); color: var(--fg); }
.doc-dash::after { content: "\2192"; opacity: 0.6; }
.doc-dash:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); transform: translateY(-2px); }
.doc-dash.is-soon { color: var(--muted); cursor: default; }
.doc-dash.is-soon::after { display: none; }
.doc-dash.is-soon:hover { transform: none; border-color: var(--line); background: transparent; }
.doc-hero-mark { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--fg); flex: 0 0 auto; }
.doc-hero-mark img, .doc-hero-mark svg { width: 34px; height: 34px; display: block; }
.doc-hero-text h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.0; letter-spacing: -0.03em; }
.doc-hero-sub { margin-top: 10px; font-size: clamp(1rem, 1.5vw, 1.18rem); color: #dcdad2; max-width: 64ch; line-height: 1.55; }
.doc-hero-meta { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- Guide page: 2-col layout (content + sticky TOC) ---------- */
.doc-body { display: grid; grid-template-columns: 1fr 208px; gap: 48px; padding-bottom: 90px; align-items: start; }
.doc-content { min-width: 0; }
.doc-toc { position: sticky; top: 96px; align-self: start; }
.doc-toc-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 12px; }
.doc-toc a { display: block; font-size: 13.5px; color: var(--muted); text-decoration: none; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); line-height: 1.35; transition: color 0.15s ease, border-color 0.15s ease; }
.doc-toc a:hover { color: var(--fg); border-left-color: var(--accent); }

/* ---------- Sections & prose ---------- */
.doc-section { padding-top: 40px; scroll-margin-top: 92px; }
.doc-section:first-child { padding-top: 8px; }
.doc-kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.doc-h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 14px; text-wrap: balance; }
.doc-h3 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; margin: 30px 0 12px; }
.doc-content p { color: #cbc9c1; font-size: 15.5px; line-height: 1.65; max-width: 70ch; }
.doc-content p + p { margin-top: 14px; }
.doc-content p em { color: #fff; font-style: normal; font-weight: 500; }
.doc-content a.inline { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(47,152,179,0.4); }
.doc-content a.inline:hover { border-bottom-color: var(--accent); }

/* ---------- Numbered quickstart steps ---------- */
.doc-steps { list-style: none; counter-reset: qs; margin: 22px 0 0; max-width: 72ch; }
.doc-steps > li { position: relative; padding: 0 0 20px 46px; counter-increment: qs; }
.doc-steps > li::before { content: counter(qs); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.doc-steps > li > p { color: #cbc9c1; font-size: 15.5px; line-height: 1.6; }
.doc-steps > li b { color: var(--fg); font-weight: 600; }
.doc-list { list-style: none; margin: 12px 0 0; max-width: 72ch; padding: 0; }
.doc-list > li { position: relative; padding: 6px 0 6px 18px; color: #cbc9c1; font-size: 15px; line-height: 1.55; }
.doc-list > li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.75; }
.doc-list > li b { color: var(--fg); font-weight: 600; }
.doc-steps .doc-list { margin-top: 10px; }
.doc-steps .doc-list > li { padding-left: 18px; font-size: 14.5px; }

/* ---------- Code blocks (verbatim, no manual highlighting → never drifts) ---------- */
.doc-code { position: relative; margin: 16px 0 0; background: rgba(10,10,12,0.6); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.doc-code-lang { position: absolute; top: 0; right: 0; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); background: rgba(255,255,255,0.04); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-left-radius: 8px; padding: 4px 10px; }
.doc-code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: #d8d6ce; }
.doc-code pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
/* Syntax highlighting (docs-highlight.js) — restrained palette on the accent family. */
.doc-code .tok-comment { color: #6a6862; font-style: italic; }
.doc-code .tok-keyword { color: #2f98b3; }
.doc-code .tok-type    { color: #71c4d9; }
.doc-code .tok-string  { color: #9ec9a3; }
.doc-code .tok-number  { color: #c9b27b; }
.doc-code .tok-annot   { color: #c9a2d4; }
.doc-inline-cmd { display: block; margin: 16px 0 0; font-family: var(--mono); font-size: 13px; color: #d8d6ce; background: rgba(10,10,12,0.6); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; overflow-x: auto; }

/* ---------- Callouts ---------- */
.doc-callout { margin: 18px 0 0; border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 10px; background: rgba(47,152,179,0.06); padding: 14px 18px; }
.doc-callout p { color: #dcdad2; font-size: 14px; line-height: 1.6; max-width: none; }
.doc-callout b { color: #fff; font-weight: 600; }
.doc-callout.warn { border-left-color: #c9b27b; background: rgba(201,178,123,0.07); }

/* ---------- Hero status note ----------
   Used where a guide has to say "there is no download yet". It must NOT look
   like a control: no fill, no border box, no hover, no pointer. The thing this
   replaced was a <span class="doc-dl is-soon" role="button"> that rendered as a
   button and did nothing when clicked — an audit read it as a broken download.
   If you are tempted to make this clickable again, ship the file first. */
.doc-hero-note { margin-top: 16px; width: 100%; max-width: 68ch; padding-left: 13px; border-left: 2px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.doc-hero-note b { color: var(--fg); font-weight: 600; }
.doc-hero-note a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cross-links row at the foot ---------- */
.doc-next { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; }
.doc-next a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; color: var(--fg); text-decoration: none; font-size: 14px; font-weight: 500; transition: border-color 0.2s ease, background 0.2s ease; }
.doc-next a:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); }

@media (max-width: 900px) {
  .doc-body { grid-template-columns: 1fr; gap: 0; }
  .doc-toc { display: none; }
}

/* ============================================================
   LIGHT DOCS THEME — guides read as documentation, not the dark
   marketing surface. Scoped to .docs-page; higher specificity so
   it overrides the dark defaults above regardless of order.
   White vendor logos (Unity/Godot reversed) stay on a dark tile
   so they remain visible without recoloring (vendor rule).
   ============================================================ */
.docs-page {
  --bg: #d8d6d1;
  --fg: #16151a;
  --muted: #43413b;
  --faint: #64625b;
  --line: rgba(20,18,16,0.19);
  --accent: #2d5a66;
  background: var(--bg);
  color: var(--fg);
}
/* nav — light scrim, dark text */
.docs-page .nav { background: linear-gradient(180deg, rgba(216,214,209,0.96) 0%, rgba(216,214,209,0.72) 60%, rgba(216,214,209,0) 100%); }
.docs-page .nav .wordmark, .docs-page .nav-links a, .docs-page .nav-links .is-disabled { color: var(--fg); }
.docs-page .nav-links a { opacity: 0.72; }
.docs-page .nav-links a:hover { opacity: 1; }
.docs-page .nav-links .is-disabled { opacity: 0.38; }
/* inline code */
.docs-page code { color: #2f2d28; background: rgba(20,18,16,0.055); border-color: rgba(20,18,16,0.1); }
/* prose — more air */
.docs-page .doc-content p { color: #302e29; font-size: 16px; line-height: 1.75; }
.docs-page .doc-content p + p { margin-top: 16px; }
.docs-page .doc-content p em { color: #111014; }
.docs-page .doc-content a.inline { color: var(--accent); border-bottom-color: rgba(41,109,126,0.4); }
.docs-page .doc-content a.inline:hover { border-bottom-color: var(--accent); }
.docs-page .doc-hero-sub { color: #3a3832; }
.docs-page .doc-steps > li > p { color: #302e29; }
.docs-page .doc-steps > li b { color: #111014; }
.docs-page .doc-steps > li::before { border-color: var(--line); color: var(--accent); }
.docs-page .doc-list > li { color: #302e29; }
.docs-page .doc-list > li b { color: #111014; }
/* rhythm — roomier sections */
.docs-page .doc-section { padding-top: 58px; }
.docs-page .doc-h2 { margin-bottom: 18px; }
.docs-page .doc-body { gap: 64px; padding-bottom: 110px; }
.docs-page .doc-hero { padding-bottom: 40px; }
/* engine mark — dark tile keeps the white logo visible on the light page */
.docs-page .doc-hero-mark { background: #17161a; border-color: #17161a; color: #f3f1ea; }
/* engine switcher — logos are white so hide them here; text-only tabs */
.docs-page .doc-switch-tab img, .docs-page .doc-switch-tab svg { display: none; }
.docs-page .doc-switch-tab { color: var(--muted); border-color: var(--line); }
.docs-page .doc-switch-tab:hover { color: var(--fg); border-color: rgba(20,18,16,0.28); }
.docs-page .doc-switch-tab.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.docs-page .doc-switch-label { color: var(--faint); }
/* code blocks — light card + light syntax palette */
.docs-page .doc-code { background: #f5f4f0; border-color: rgba(20,18,16,0.13); }
.docs-page .doc-code-lang { color: var(--faint); background: rgba(20,18,16,0.04); border-color: rgba(20,18,16,0.1); }
.docs-page .doc-code pre { color: #2f2d28; }
.docs-page .doc-code .tok-comment { color: #8b8880; }
.docs-page .doc-code .tok-keyword { color: #296d7e; }
.docs-page .doc-code .tok-type    { color: #27616f; }
.docs-page .doc-code .tok-string  { color: #2f7d4a; }
.docs-page .doc-code .tok-number  { color: #96631c; }
.docs-page .doc-code .tok-annot   { color: #8a3fa0; }
.docs-page .doc-inline-cmd { color: #2a2823; background: #f5f4f0; border-color: rgba(20,18,16,0.13); }
/* callouts */
.docs-page .doc-callout { background: rgba(41,109,126,0.06); border-color: rgba(20,18,16,0.1); border-left-color: var(--accent); }
.docs-page .doc-callout p { color: #3a3833; }
.docs-page .doc-callout b { color: #111014; }
.docs-page .doc-callout.warn { border-left-color: #b0862a; background: rgba(176,134,42,0.09); }
/* TOC */
.docs-page .doc-toc a { color: var(--muted); border-left-color: var(--line); }
.docs-page .doc-toc a:hover { color: var(--fg); border-left-color: var(--accent); }
/* kicker / meta */
.docs-page .doc-kicker { color: var(--accent); }
.docs-page .doc-hero-meta { color: var(--faint); }
/* action buttons — dark download, light dashboard */
.docs-page .doc-dl { background: #17161a; color: #f3f1ea; }
.docs-page .doc-dl.is-soon { background: rgba(20,18,16,0.05); color: var(--muted); border-color: var(--line); }
.docs-page .doc-dl-soon { color: var(--faint); border-color: var(--line); }
.docs-page .doc-dash { border-color: var(--line); color: var(--fg); }
.docs-page .doc-dash.is-soon { color: var(--muted); }
.docs-page .doc-dash:hover { border-color: rgba(20,18,16,0.28); background: rgba(20,18,16,0.03); }
/* cross-links */
.docs-page .doc-next { border-top-color: var(--line); }
.docs-page .doc-next a { color: var(--fg); border-color: var(--line); }
.docs-page .doc-next a:hover { border-color: rgba(20,18,16,0.28); background: rgba(20,18,16,0.03); }
/* status badge (from styles.css) on light */
.docs-page .gtag { color: var(--muted); border-color: var(--line); }
.docs-page .gtag.gtag-live { color: #2f7d4a; border-color: rgba(47,125,74,0.42); }
.docs-page .gtag.gtag-live::before { color: #2f7d4a; }
/* footer legal */
.docs-page .legal-note { color: var(--faint); }
