/* GZLighTek wiki — shared styles for /wiki/ (single-language reference pages).
   Tokens and chrome follow services/ai-development/index.html. When you change this file,
   bump the ?v= number on every <link href="/assets/css/wiki.css?v=N"> in /wiki/. */

:root {
  --bg-primary:    #080A12;
  --bg-surface:    #0D1020;
  --bg-surface2:   #141728;
  --bg-surface3:   #1C2038;
  --cyan:          #00C8E8;
  --cyan-glow:     rgba(0,200,232,0.15);
  --text-primary:  #E8EEFF;
  --text-secondary:#8A90B0;
  --text-tertiary: #6870A0;
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(0,200,232,0.25);
  --border-active: rgba(0,200,232,0.5);
  --code-bg:       #0A0D1A;
  --radius-sm: 8px; --radius-md: 14px; --radius-full: 999px;
  --font-display: 'Orbitron', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
body.light {
  --bg-primary:    #F0F4FF;
  --bg-surface:    #FFFFFF;
  --bg-surface2:   #E9EEFF;
  --bg-surface3:   #DDE4FF;
  --text-primary:  #0C0F24;
  --text-secondary:#252A58;
  --text-tertiary: #4E5280;
  --border:        rgba(0,0,40,0.09);
  --code-bg:       #F6F8FF;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font: 400 16px/1.7 var(--font-body); color: var(--text-primary); background: var(--bg-primary); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.doc-body a, .doc-lead a, .disclaimer a, .callout a { color: var(--cyan); text-underline-offset: 3px; }
h1 { font: 900 clamp(26px, 4.2vw, 40px)/1.25 var(--font-display); letter-spacing: -0.5px; }
h2 { font: 700 clamp(21px, 2.6vw, 26px)/1.3 var(--font-body); letter-spacing: -0.2px; margin: 56px 0 14px; }
h3 { font: 600 17px/1.4 var(--font-body); margin: 32px 0 10px; }
section[id], h2[id], h3[id] { scroll-margin-top: 84px; }

/* NAV */
nav.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6%; height: 64px;
  background: rgba(8,10,18,0.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
body.light nav.top { background: rgba(240,244,255,0.92); }
.logo { font-family: var(--font-display); font-weight: 900; text-decoration: none; font-size: 18px; display: inline-flex; align-items: center; gap: 1px; }
.logo-gz { color: var(--cyan); } .logo-light { color: var(--text-primary); font-weight: 700; } .logo-tek { color: var(--text-secondary); font-weight: 400; }
.nav-center { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-center li a { text-decoration: none; color: var(--text-secondary); font: 500 14px var(--font-body); padding: 8px 14px; border-radius: var(--radius-sm); display: block; transition: color 0.2s, background 0.2s; }
.nav-center li a:hover, .nav-center li a.active { color: var(--text-primary); background: rgba(255,255,255,0.05); }
body.light .nav-center li a:hover, body.light .nav-center li a.active { background: rgba(0,0,40,0.05); }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.nav-dropdown-toggle::after { content: '▾'; font-size: 10px; color: var(--text-tertiary); transition: transform 0.25s; }
.nav-dropdown.open .nav-dropdown-toggle::after { transform: rotate(180deg); }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 10px); left: 0; background: rgba(10,13,26,0.95); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; min-width: 280px; box-shadow: 0 24px 48px rgba(0,0,0,0.6); }
body.light .nav-dropdown-menu { background: rgba(255,255,255,0.97); box-shadow: 0 24px 48px rgba(0,0,0,0.12); }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: flex; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-secondary); transition: background 0.15s; }
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.06); }
body.light .nav-dropdown-menu a:hover { background: rgba(0,0,40,0.05); }
.nav-dropdown-menu a { align-items: center; gap: 10px; }
.app-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-dd-group { font: 700 10px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); padding: 8px 12px 3px; pointer-events: none; }
.nav-dd-divider { height: 1px; background: var(--border); margin: 5px 8px; }
.nav-dropdown-menu a[aria-current="page"] .nav-dd-name, .nav-mobile .sub-links a[aria-current="page"] { color: var(--cyan); }
.nav-dd-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-dd-name { font: 600 13px var(--font-body); color: var(--text-secondary); line-height: 1.3; }
.nav-dd-sub { font: 400 11px var(--font-body); color: var(--text-tertiary); line-height: 1.35; }
.nav-dropdown-menu a:hover .nav-dd-name { color: var(--text-primary); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 32px; height: 32px; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
body.light .theme-toggle:hover { background: rgba(0,0,40,0.05); }
#theme-icon-sun { display: none; }
body.light #theme-icon-moon { display: none; }
body.light #theme-icon-sun { display: block; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: rgba(6,8,15,0.97); padding: 24px 6%; overflow-y: auto; z-index: 99; }
body.light .nav-mobile { background: rgba(240,244,255,0.98); }
.nav-mobile.open { display: block; }
.nav-mobile .sub-links { padding-left: 16px; }
.nav-mobile .sub-links a { font-size: 15px; color: var(--text-secondary); padding: 10px 0; }
.nav-mobile a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text-primary); font: 500 16px var(--font-body); }

/* PAGE FRAME */
.page { max-width: 1120px; margin: 0 auto; padding: 108px 6% 96px; }
.crumbs { font: 500 13px var(--font-body); color: var(--text-tertiary); margin-bottom: 18px; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs span[aria-hidden] { margin: 0 6px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font: 500 13px var(--font-body); color: var(--text-tertiary); }
.doc-meta b { color: var(--text-secondary); font-weight: 600; }
.doc-lead { margin-top: 18px; max-width: 720px; color: var(--text-secondary); font-size: 17px; }

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; margin-top: 40px; align-items: start; }
.doc-toc { position: sticky; top: 88px; font-size: 14px; }
.doc-toc-label { display: block; font: 600 11px/1 var(--font-body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 12px; }
.doc-toc ol { list-style: none; border-left: 1px solid var(--border); }
.doc-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; text-decoration: none; color: var(--text-secondary); line-height: 1.4; }
.doc-toc li a:hover { color: var(--text-primary); border-left-color: var(--cyan); }
.doc-toc li a.active { color: var(--text-primary); border-left-color: var(--cyan); font-weight: 600; }
/* reserves the bold width (data-title is set in wiki.js) so the active entry does not re-wrap the list */
.doc-toc li a::after { content: attr(data-title); display: block; height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }
.doc-body { max-width: 780px; min-width: 0; }
.doc-body > :first-child, .doc-body > h2:first-child { margin-top: 0; }
.doc-body p { color: var(--text-secondary); margin-bottom: 16px; }
.doc-body ul, .doc-body ol { margin: 0 0 18px 22px; color: var(--text-secondary); }
.doc-body li { margin-bottom: 6px; }
.doc-body strong { color: var(--text-primary); font-weight: 600; }

/* inline + block code */
code { font: 500 0.88em var(--font-mono); background: var(--bg-surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text-primary); word-break: break-word; }
.code { position: relative; margin: 0 0 20px; }
.code pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font: 400 13.5px/1.65 var(--font-mono); color: var(--text-primary); tab-size: 2; }
.code pre code { background: none; border: none; padding: 0; font: inherit; word-break: normal; }
.code .cap { display: block; font: 600 11px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: 600 11px var(--font-body); color: var(--text-secondary); background: var(--bg-surface2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; cursor: pointer; }
.code.has-cap .copy-btn { top: 28px; }
.copy-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ref { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.ref caption { text-align: left; padding: 10px 14px; font: 600 12px var(--font-body); letter-spacing: 0.5px; color: var(--text-tertiary); caption-side: top; }
.ref th, .ref td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--border); }
.ref thead th { background: var(--bg-surface); font: 600 12px var(--font-body); letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); border-top: none; white-space: nowrap; }
.ref td:first-child { white-space: nowrap; }
.ref td { color: var(--text-secondary); }
.ref td:first-child code { color: var(--cyan); }

/* callouts and checklists */
.callout { background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: var(--radius-md); padding: 18px 22px; margin: 0 0 22px; }
.callout > :last-child { margin-bottom: 0; }
.callout h3 { margin: 0 0 8px; font-size: 15px; }
.callout p { font-size: 15px; }
.callout.warn { border-left-color: #F59E0B; }
.checklist { list-style: none; margin-left: 0 !important; }
.checklist li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); margin: 0; }
.checklist li:last-child { border-bottom: 1px solid var(--border); }
.checklist li::before { content: '☐'; color: var(--cyan); font-size: 17px; line-height: 1.5; flex-shrink: 0; }
.qa { list-style: none; counter-reset: q; margin-left: 0 !important; }
.qa li { counter-increment: q; display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); margin: 0; }
.qa li:last-child { border-bottom: 1px solid var(--border); }
.qa li::before { content: counter(q, decimal-leading-zero); font: 700 12px var(--font-display); color: var(--cyan); padding-top: 4px; }
.qa li b { display: block; color: var(--text-primary); font-weight: 600; }
.verify { font-size: 14px; }
.verify > .cap { display: block; font: 600 11px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); margin: 4px 0 8px; }

/* INDEX */
.idx { margin-top: 36px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.idx-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 18px 22px; text-decoration: none; border-top: 1px solid var(--border); transition: background 0.15s; }
.idx-row:first-child { border-top: none; }
.idx-row:hover { background: var(--bg-surface); }
.idx-num { font: 700 12px var(--font-display); color: var(--cyan); }
.idx-title { display: block; font: 600 17px/1.4 var(--font-body); color: var(--text-primary); }
.idx-desc { display: block; font-size: 14.5px; color: var(--text-secondary); margin-top: 2px; }
.idx-date { font: 500 12px var(--font-body); color: var(--text-tertiary); white-space: nowrap; }

/* prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; }
.pager a { display: block; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.pager a:hover { border-color: var(--border-hover); background: var(--bg-surface); }
.pager .dir { display: block; font: 600 11px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px; }
.pager .ttl { color: var(--text-primary); font-weight: 600; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }
.disclaimer { margin-top: 36px; font-size: 13px; color: var(--text-tertiary); max-width: 720px; }

/* FOOTER */
footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 36px 6%; }
.footer-in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; }
.footer-links a { text-decoration: none; color: var(--text-secondary); font-size: 14px; }
.footer-links a:hover { color: var(--cyan); }
.footer-copy { width: 100%; font-size: 13px; color: var(--text-secondary); }

@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .doc-toc { position: static; }
  .doc-toc ol { display: flex; flex-wrap: wrap; gap: 6px 8px; border-left: none; }
  .doc-toc li a { padding: 6px 12px; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 13px; }
}
@media (max-width: 768px) {
  .nav-center { display: none; }
  .nav-toggle { display: flex; }
  .page { padding: 92px 5% 72px; }
  .idx-row { grid-template-columns: 36px minmax(0, 1fr); }
  .idx-date { grid-column: 2; }
}
@media (max-width: 480px) {
  .page { padding: 84px 20px 60px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  footer { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
