/* Scene Director docs — static, no JS. Light editorial style. */

:root {
  --bg-deep: #2e303e;
  --bg-surface: #2e303e;
  --bg-elevated: #3a3d4f;
  --border: #4a4f66;
  --text: #e8ebf6;
  --text-muted: #b8bed2;
  --accent: #9aaeff;
  --accent-soft: rgba(154, 174, 255, 0.22);
  --code-bg: #252836;
  --link: #d3ddff;
  --link-hover: #edf2ff;
  --radius: 8px;
  --font-ui: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  --sidebar-width: 260px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
}

body::before {
  content: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.site-header__icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: block;
}

.site-header__brand {
  display: flex;
  align-items: baseline;
  flex: 1;
  min-width: 0;
  gap: 0.65rem;
}

.site-header__title {
  margin: 0;
  flex: 0 0 auto;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

.site-header__title a {
  color: inherit;
  text-decoration: none;
}

.site-header__title a:hover {
  color: var(--accent);
}

.site-header__tagline {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.35;
}

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  flex: 0 0 var(--sidebar-width);
  padding: 1.75rem 1.25rem 2rem 2rem;
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.sidebar__group--spaced {
  margin-top: 1.5rem;
}

.sidebar__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}

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

.sidebar li {
  margin: 0 0 0.25rem;
}

.sidebar a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 2px solid transparent;
}

.sidebar a:hover {
  color: var(--text);
  background: #3b4056;
}

.sidebar a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2rem 3rem 2.25rem;
}

.prose {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h1 {
  font-family: var(--font-ui);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  color: #efaafe;
  line-height: 1.25;
}

.prose h2 {
  font-family: var(--font-ui);
  font-size: 1.3rem;
  font-weight: 560;
  margin: 2rem 0 0.75rem;
  padding-top: 0.25rem;
  color: #f899af;
  border-bottom: 2px solid #8f97c3;
  padding-bottom: 0.45rem;
}

.prose h3 {
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 520;
  margin: 1.5rem 0 0.5rem;
  color: #b5a7cb;
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.prose li {
  margin: 0.25rem 0;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  color: #f4f6ff;
  font-weight: 700;
}

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

.prose a:visited {
  color: #d9d6ff;
}

.prose a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.prose a code,
.prose a .hl-inline {
  color: var(--link-hover);
  border-color: #6a759f;
  background: #353950;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose blockquote {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--accent);
  background: #3b3f53;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #dbe1f4;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 4px;
  border: 1px solid #525876;
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--code-bg);
  border: 1px solid #525876;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* Build-time C++ highlighting (no JS) — blocks + inline backticks.
   Palette tuned for the dark code background (#252836); each color
   targets >= 4.5:1 contrast so class names like `UActionNode` stay readable. */
.prose pre code.hl-code,
.prose code.hl-inline {
  color: #e8ebf6;
}

.prose pre code.hl-code .hl-keyword,
.prose code.hl-inline .hl-keyword {
  color: #c792ea;
  font-weight: 500;
}

.prose pre code.hl-code .hl-type,
.prose code.hl-inline .hl-type {
  color: #7aa2f7;
  font-weight: 500;
}

.prose pre code.hl-code .hl-macro,
.prose code.hl-inline .hl-macro {
  color: #ffcb6b;
}

.prose pre code.hl-code .hl-string,
.prose code.hl-inline .hl-string {
  color: #c3e88d;
}

.prose pre code.hl-code .hl-comment,
.prose code.hl-inline .hl-comment {
  color: #a4adc8;
  font-style: italic;
}

.prose pre code.hl-code .hl-number,
.prose code.hl-inline .hl-number {
  color: #ff9e64;
}

.prose pre code.hl-code .hl-preproc,
.prose code.hl-inline .hl-preproc {
  color: #bb9af7;
}

/* Tab groups: Blueprint / C++ (radio + per-block <style> for dynamic ids) */
.doc-tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}

.doc-tabs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.doc-tabs-labels {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #383c50;
}

.doc-tabs-labels label {
  flex: 1;
  text-align: center;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.doc-tabs-labels label:hover {
  color: var(--text);
  background: #454a62;
}

.doc-tabs-panels {
  background: var(--bg-surface);
}

.doc-tabs-panel-inner {
  padding: 1.15rem 1.25rem 1.35rem;
}

.doc-tabs-panel-inner > *:first-child {
  margin-top: 0;
}

.doc-tabs-panel-inner > *:last-child {
  margin-bottom: 0;
}

.doc-tabs-panel-inner h2 {
  font-size: 1.05rem;
}

.doc-tabs-panel-inner h3 {
  margin-top: 1.15rem;
  font-size: 1rem;
}

.doc-tabs-panel-inner h3:first-child {
  margin-top: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  margin: 1rem 0 1.5rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.prose th {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
}

.prose tr:nth-child(even) td {
  background: #363a4e;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.prose .footnote {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .site-header__brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .site-header__title {
    white-space: normal;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    flex: none;
    width: 100%;
    max-height: none;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
  }

  .content {
    padding: 1.5rem 1.5rem 2.5rem;
  }
}

@media print {
  body::before {
    display: none;
  }

  .site-header {
    position: relative;
    background: #fff;
    color: #000;
  }

  .sidebar {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose {
    color: #111;
  }
}
