/* ahLOOKah — documentation stylesheet (shared across all docs pages).
   Monochrome theme: pure black background, white text, neutral grays only. */

:root {
  --bg: #000000;
  --panel: #101010;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --muted: #8a8a8a;
  --sidebar-w: 264px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

a { color: var(--text); text-decoration: none; }

/* ---------- Top bar (mobile only) ---------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.3px;
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar__header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar__brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: 0.5px;
}

.sidebar__tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.sidebar__nav {
  flex: 1;
  padding: 12px 12px 20px;
}

.sidebar__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar__nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.sidebar__nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.sidebar__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.sidebar__footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar__footer a:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
  text-decoration: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.55);
}

/* ---------- Content ---------- */
.content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 48px 48px 80px;
}

.article {
  max-width: 820px;
}

.article h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.article .lede {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 0 32px;
}

.article h2 {
  font-size: 1.45rem;
  margin: 40px 0 12px;
  letter-spacing: -0.3px;
  padding-top: 8px;
}

.article h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
}

.article p { margin: 0 0 16px; }

.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin: 6px 0; }

.article strong { color: #fff; }

.article a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article a:hover { color: var(--muted); }

code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.88em;
  font-family: var(--mono);
}

pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9rem;
}
pre code { background: none; border: none; padding: 0; }

kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.82em;
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th { color: #fff; font-weight: 600; }

/* ---------- Screenshots ---------- */
.figure {
  margin: 24px 0 28px;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
}

.figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Callouts ---------- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  background: var(--panel);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 0.95rem;
}
.callout.tip { border-left-color: var(--muted); }
.callout.warn { border-left-color: var(--border-strong); }
.callout p { margin: 0; }
/* Only the leading word of a callout is its label and sits on its own line.
   Any later <strong> is inline emphasis — it must NOT be forced onto a line
   of its own (that used to break sentences mid-flow). */
.callout > strong,
.callout p > strong:first-child { display: block; margin-bottom: 2px; }

/* ---------- Video embed ---------- */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin: 24px 0 32px;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Prev / next footer ---------- */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pager a span.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.pager a span.title { color: var(--text); font-weight: 600; }
.pager a.next { text-align: right; align-items: flex-end; }
.pager a:hover {
  text-decoration: none;
  background: var(--panel);
  border-color: var(--border-strong);
}
.pager a:not(.next) span.label::before { content: "←  "; }
.pager a.next span.label::after { content: "  →"; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }

  .content {
    margin-left: 0;
    padding: 32px 20px 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* The complete scripts guide stays on one page, with compact anchor navigation. */
.script-doc-toc { padding: 16px 20px; border: 1px solid #343440; border-radius: 8px; margin: 24px 0; }
.script-doc-toc ul { columns: 2 220px; margin-bottom: 0; font-size: .85rem; }
.script-doc-toc li { break-inside: avoid; }
