/* Aimogen Pro documentation
   ------------------------------------------------------------------
   Single stylesheet for the whole documentation site. Tokens first,
   then layout, then components. Light and dark are both supported;
   dark follows the visitor's system preference. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-sunk: #eef0f4;
  --surface: #ffffff;
  --border: #e2e5ea;
  --border-strong: #cdd2da;

  --text: #1d2027;
  --text-soft: #565d6b;
  --text-faint: #7b8391;

  --accent: #5b52e0;
  --accent-soft: #efedfd;
  --accent-text: #4139c4;

  --ok: #1a7f4b;
  --ok-soft: #e7f5ed;
  --warn: #9a6300;
  --warn-soft: #fdf3e0;
  --danger: #b3261e;
  --danger-soft: #fdecea;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 30, .05), 0 4px 14px rgba(16, 20, 30, .06);

  --sidebar-w: 290px;
  --content-max: 860px;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --bg-soft: #1a1d24;
    --bg-sunk: #21252e;
    --surface: #1a1d24;
    --border: #2b303a;
    --border-strong: #3a4150;

    --text: #e6e8ed;
    --text-soft: #a8afbd;
    --text-faint: #7d8494;

    --accent: #9b93ff;
    --accent-soft: #23213c;
    --accent-text: #b3adff;

    --ok: #58d69a;
    --ok-soft: #14291f;
    --warn: #e0ac52;
    --warn-soft: #2b2415;
    --danger: #f28b82;
    --danger-soft: #2e1b19;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  height: 100%;
  max-width: 1440px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #6a5bff, #9d4edd);
  color: #fff; font-weight: 700; font-size: 16px;
  display: grid; place-items: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14.5px; }
.brand-text span { font-size: 11.5px; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 36px; padding: 0 12px;
  font: inherit; font-size: 14px;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--surface); }

.search-results {
  position: absolute; top: 42px; left: 0; right: 0;
  max-height: 62vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 6px;
}
.search-results a {
  display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none;
}
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results .r-title { font-weight: 600; font-size: 14px; display: block; }
.search-results .r-section { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.search-results .r-snippet { font-size: 12.5px; color: var(--text-soft); display: block; margin-top: 2px; }
.search-results .empty { padding: 12px; color: var(--text-soft); font-size: 14px; }

.header-links { display: flex; gap: 16px; font-size: 14px; flex: none; }
.nav-toggle {
  display: none; flex: none;
  font: inherit; font-size: 14px; padding: 6px 12px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}

/* ---------------------------------------------------------------- layout */

.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 40px; padding: 0 20px;
  align-items: start;
}

.sidebar {
  position: sticky; top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 0 60px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}

.nav-section { margin-bottom: 2px; }
.nav-section > summary {
  list-style: none; cursor: pointer;
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 650; letter-spacing: .02em;
  color: var(--text); text-transform: uppercase;
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::before {
  content: "\25B8"; display: inline-block; width: 14px;
  color: var(--text-faint); transition: transform .15s ease;
}
.nav-section[open] > summary::before { transform: rotate(90deg); }
.nav-section > summary:hover { background: var(--bg-soft); }
.nav-section ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 14px; border-left: 1px solid var(--border); }
.nav-section li a {
  display: block; padding: 5px 10px; border-radius: 6px;
  font-size: 14px; color: var(--text-soft); text-decoration: none;
}
.nav-section li a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-section li a.current { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.content { min-width: 0; padding: 24px 0 72px; max-width: var(--content-max); }

/* ------------------------------------------------------------ breadcrumbs */

.breadcrumbs { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumbs .sep { margin: 0 8px; }
.breadcrumbs .crumb-current { color: var(--text-soft); }

/* ------------------------------------------------------------- typography */

.doc h1 {
  font-size: 34px; line-height: 1.2; letter-spacing: -.02em;
  margin: 0 0 10px;
}
.doc .lede { font-size: 18px; color: var(--text-soft); margin: 0 0 28px; line-height: 1.55; }

.doc h2 {
  font-size: 24px; line-height: 1.3; letter-spacing: -.01em;
  margin: 44px 0 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.doc h3 { font-size: 18.5px; margin: 30px 0 10px; }
.doc h4 { font-size: 16px; margin: 24px 0 8px; color: var(--text); }
.doc h5 { font-size: 14.5px; margin: 20px 0 6px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }

.doc h2 .anchor, .doc h3 .anchor, .doc h4 .anchor {
  margin-left: 8px; color: var(--border-strong); font-weight: 400;
  opacity: 0; text-decoration: none;
}
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor { opacity: 1; }
.doc h1 .anchor { display: none; }

.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 24px; }
.doc li { margin-bottom: 6px; }
.doc li > ul, .doc li > ol { margin: 6px 0 4px; }

.doc blockquote {
  margin: 0 0 18px; padding: 2px 0 2px 18px;
  border-left: 3px solid var(--border-strong); color: var(--text-soft);
}
.doc blockquote p:last-child { margin-bottom: 0; }

.doc hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

/* ------------------------------------------------------------------- code */

.doc code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--bg-sunk); padding: .12em .38em; border-radius: 4px;
  word-break: break-word;
}
.codeblock { position: relative; margin: 0 0 18px; }
.codeblock pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13.5px; line-height: 1.6;
}
.codeblock pre code { background: none; padding: 0; font-size: inherit; word-break: normal; }
.code-lang {
  position: absolute; top: 0; right: 0;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint); background: var(--bg-sunk);
  padding: 2px 8px; border-radius: 0 var(--radius) 0 var(--radius);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.copy-btn {
  position: absolute; top: 6px; right: 6px;
  font: inherit; font-size: 11.5px; padding: 3px 9px;
  background: var(--surface); color: var(--text-soft);
  border: 1px solid var(--border); border-radius: 5px;
  cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
.codeblock:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.codeblock:hover .code-lang { opacity: 0; }

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc thead th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc td code { white-space: nowrap; }

/* --------------------------------------------------------------- callouts */

.callout {
  margin: 0 0 20px; padding: 14px 16px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong); border-radius: var(--radius);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  margin: 0 0 6px; color: var(--text-soft);
}
.callout-note { border-left-color: var(--accent); }
.callout-note .callout-title { color: var(--accent-text); }
.callout-tip { border-left-color: var(--ok); background: var(--ok-soft); }
.callout-tip .callout-title { color: var(--ok); }
.callout-warning { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-warning .callout-title { color: var(--warn); }
.callout-danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout-danger .callout-title { color: var(--danger); }
.callout-pro { border-left-color: var(--accent); background: var(--accent-soft); }
.callout-pro .callout-title { color: var(--accent-text); }
.callout-free { border-left-color: var(--ok); background: var(--ok-soft); }
.callout-free .callout-title { color: var(--ok); }
.callout-legacy { border-left-color: var(--text-faint); }

/* ------------------------------------------------------------------- TOC */

.toc {
  margin: 0 0 32px; padding: 14px 18px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.toc-title { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 650; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc li a { display: block; padding: 3px 0; font-size: 14px; color: var(--text-soft); }
.toc li a:hover { color: var(--accent-text); }
.toc .toc-l3 { padding-left: 16px; font-size: 13.5px; }

/* ----------------------------------------------------------------- videos */

.video { margin: 0 0 26px; }
.video-frame { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-sunk); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: 10px; font-size: 14px; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.video figcaption strong { color: var(--text); }
.video-note { flex: 1 1 100%; }
.video-link { font-size: 13px; white-space: nowrap; }
.video-legacy {
  margin: 8px 0 0; padding: 8px 12px; font-size: 13px;
  color: var(--text-soft); background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* ------------------------------------------------------------- card grids */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 0 0 24px; }
.cards > a {
  display: block; padding: 14px 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); transition: border-color .12s ease, transform .12s ease;
}
.cards > a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.cards strong { display: block; font-size: 15px; margin-bottom: 3px; }
.cards span { font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }

/* --------------------------------------------------------------- helpers */

.badge {
  display: inline-block; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle;
}
.badge-pro { background: var(--accent-soft); color: var(--accent-text); }
.badge-free { background: var(--ok-soft); color: var(--ok); }

.page-help {
  margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 14px; color: var(--text-soft);
}
.page-help p { margin: 0; }

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 32px; max-width: var(--content-max);
}
.pager a {
  display: block; padding: 12px 16px; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 2px; }
.pager strong { font-size: 14.5px; font-weight: 600; }
.pager-next { text-align: right; }

.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-soft);
  padding: 26px 20px; text-align: center;
  font-size: 13.5px; color: var(--text-soft);
}
.site-footer p { margin: 0 0 5px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar {
    display: none; position: static; max-height: none;
    border-right: 0; border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }
  .sidebar.open { display: block; }
  .nav-toggle { display: block; }
  .header-links { display: none; }
  .brand-text span { display: none; }
  .doc h1 { font-size: 28px; }
  .content { padding-top: 18px; }
}

@media (max-width: 620px) {
  .search { max-width: none; }
  .brand-text { display: none; }
  .pager { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .sidebar, .pager, .toc, .site-footer, .skip-link { display: none; }
  .layout { display: block; padding: 0; }
  body { font-size: 12pt; }
}

/* ---------------------------------------------- screenshot capture slots
   Only rendered by `build.py --show-screenshots`. Never present in a
   production build - the marker is an HTML comment there. */

.shot-todo {
  margin: 0 0 22px;
  padding: 22px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  text-align: center;
}
.shot-todo-label {
  margin: 0 0 6px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn);
}
.shot-todo-desc {
  margin: 0; max-width: 60ch; margin-inline: auto;
  font-size: 14px; line-height: 1.55; color: var(--text-soft);
}

/* Captured screenshots, once the marker is replaced with an image. */
.doc img {
  max-width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: block; margin: 0 0 8px;
}
.doc figure { margin: 0 0 24px; }
.doc figure img { margin-bottom: 8px; }
.doc figcaption {
  font-size: 13.5px; color: var(--text-soft); line-height: 1.5;
}
