/* BlixtFS docs. Colours are tokens; the dark set is the brand default and the
   light set is chosen by the saved theme or the system preference. */
:root {
  --bg: #131C27;
  --surface: #1A2533;
  --surface-2: #1E2B3A;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #E7EEF4;
  --text-strong: #FFFFFF;
  --muted: #8BA7BC;
  --link: #6AB4DB;
  --brand: #4A9CC7;
  --accent: #F5A623;
  --active-bg: rgba(74, 156, 199, 0.14);
  --code-bg: #0E151E;
  --inline-code-bg: rgba(255, 255, 255, 0.07);
  --note: #4A9CC7;
  --tip: #3FB68B;
  --important: #A58BF0;
  --warning: #F5A623;
  --caution: #EF6B6B;
  --topbar-h: 61px;
  color-scheme: dark;
}
html.light {
  --bg: #FFFFFF;
  --surface: #F4F8FB;
  --surface-2: #E8F0F8;
  --border: rgba(30, 43, 58, 0.10);
  --border-strong: rgba(30, 43, 58, 0.18);
  --text: #26394B;
  --text-strong: #131C27;
  --muted: #587387;
  --link: #1A7AAD;
  --brand: #1A7AAD;
  --accent: #C77A06;
  --active-bg: rgba(26, 122, 173, 0.10);
  --code-bg: #F4F8FB;
  --inline-code-bg: rgba(30, 43, 58, 0.06);
  --note: #1A7AAD;
  --tip: #1E8A62;
  --important: #6E4FCB;
  --warning: #B06C00;
  --caution: #C23B3B;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 "DM Sans", ui-sans-serif, system-ui, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: "Syne", ui-sans-serif, system-ui, sans-serif; color: var(--text-strong); line-height: 1.25; }
code, kbd, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

html.light .topbar { border-bottom-color: rgba(30, 43, 58, 0.12); }

.staging-banner { background: var(--accent); color: #000; text-align: center; padding: 4px; font-size: 13px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.brand-mark { display: flex; align-items: center; margin-right: -6px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text-strong);
  font: 700 18px "Syne", sans-serif; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-docs { color: var(--muted); font-weight: 600; }
.version-badge { font-size: 12px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 8px; }
/* The header links match website/templates/base.html exactly: Tailwind's
   space-x-6 (24px), text-sm (14px), and a px-3 py-1 rounded gradient button.
   Values are literal rather than themed so the two headers cannot drift. */
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 24px;
  font-size: 14px; line-height: 20px; }
.topbar-links a { color: #fff; }
html.light .topbar-links a { color: #1e2b3a; }
.topbar-links a:hover { text-decoration: none; }
.topbar-links a.cta { padding: 4px 12px; border-radius: 4px; font-weight: 600; color: #000;
  background: linear-gradient(to right, #F5A623, #E8870A); }
.theme-toggle { padding: 4px; border-radius: 4px; border: 0; background: none;
  color: inherit; font-size: 14px; line-height: 20px; cursor: pointer; transition: background-color 0.15s; }
.theme-toggle:hover { background: rgba(255, 255, 255, 0.1); }
html.light .theme-toggle:hover { background: rgba(30, 43, 58, 0.1); }
.icon-button { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer; }
.icon-button:hover { color: var(--text-strong); border-color: var(--border-strong); }
.nav-toggle { display: none; }
.icon-moon { display: none; }
html.light .icon-moon { display: inline; }
html.light .icon-sun { display: none; }

/* Search */
.search { position: relative; flex: 0 1 380px; margin-left: 12px; }
.search input {
  width: 100%; height: 36px; padding: 0 34px 0 34px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px;
}
.search input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.search-icon { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search-kbd { position: absolute; right: 9px; top: 8px; font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; }
.search-results {
  position: absolute; top: 42px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  max-height: 70vh; overflow-y: auto; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--active-bg); text-decoration: none; }
.search-results .r-title { font-weight: 500; color: var(--text-strong); }
.search-results .r-section { font-size: 12px; color: var(--muted); margin-left: 6px; }
.search-results .r-snippet { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.search-results mark { background: none; color: var(--accent); font-weight: 500; }
.search-results .r-empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* Three-column layout */
.layout {
  display: grid; grid-template-columns: 290px minmax(0, 1fr) 220px;
  max-width: 1480px; margin: 0 auto;
}
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 20px 12px 40px 16px; border-right: 1px solid var(--border);
  font-size: 14.5px;
}

/* Navigation tree */
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { margin-left: 12px; padding-left: 8px; border-left: 1px solid var(--border); }
.tree li { margin: 1px 0; }
.tree a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text); line-height: 1.35; }
.tree a:hover { background: var(--active-bg); text-decoration: none; }
.tree a.active { background: var(--active-bg); color: var(--text-strong); font-weight: 500;
  box-shadow: inset 2px 0 0 var(--brand); }
.tree > ul:nth-of-type(2) > li > a,
.tree > ul:nth-of-type(2) > li > details > summary > a { font-weight: 500; color: var(--text-strong); }
.tree summary { list-style: none; position: relative; cursor: pointer; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary > a { padding-right: 28px; }
.tree summary::after {
  content: ""; position: absolute; right: 10px; top: 12px; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform 0.15s; pointer-events: none;
}
.tree details[open] > summary::after { transform: rotate(45deg); top: 10px; }
.draft-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warning);
  border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 8px; }

/* Main column */
.main { min-width: 0; padding: 28px 48px 40px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 0; font-size: 13.5px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.content { max-width: 780px; }
.page-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 10px; letter-spacing: -0.01em; }
.lead { font-size: 18.5px; color: var(--muted); margin: 0; }
.page-meta { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* Prose */
.content h2 { font-size: 25px; margin: 44px 0 12px; }
.content h3 { font-size: 19px; margin: 30px 0 8px; }
.content h4 { font-size: 16px; margin: 24px 0 6px; }
.content p, .content ul, .content ol { margin: 0 0 16px; }
.content li { margin: 4px 0; }
.content li > ul, .content li > ol { margin: 4px 0 0; }
.content strong { color: var(--text-strong); font-weight: 700; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.content img, .content svg.diagram { max-width: 100%; height: auto; }
.content :not(pre) > code { background: var(--inline-code-bg); padding: 1px 6px; border-radius: 4px; font-size: 0.86em; }
.content pre { background: var(--code-bg); border: 1px solid var(--border); padding: 14px 16px;
  border-radius: 8px; overflow-x: auto; font-size: 13.5px; line-height: 1.55; margin: 0 0 20px; }
.content pre code { color: var(--text); }
.content table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; display: block; overflow-x: auto; }
.content th { text-align: left; font-weight: 500; color: var(--text-strong); background: var(--surface); }
.content th, .content td { border-bottom: 1px solid var(--border); padding: 8px 12px; vertical-align: top; }
.content blockquote { margin: 0 0 20px; padding: 12px 16px; border-left: 3px solid var(--border-strong);
  background: var(--surface); border-radius: 0 8px 8px 0; }
.content blockquote > :last-child { margin-bottom: 0; }

.content dl { margin: 0 0 20px; }
.content dt { font-weight: 700; color: var(--text-strong); margin-top: 14px; }
.content dd { margin: 2px 0 0 18px; }
.content kbd { font-size: 0.8em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* Callouts: > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] */
.content .callout { --c: var(--note); border-left-color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, transparent); }
.content .callout::before { display: block; font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c); margin-bottom: 4px; }
.content .callout-note::before { content: "Note"; }
.content .callout-tip { --c: var(--tip); }
.content .callout-tip::before { content: "Tip"; }
.content .callout-important { --c: var(--important); }
.content .callout-important::before { content: "Important"; }
.content .callout-warning { --c: var(--warning); }
.content .callout-warning::before { content: "Warning"; }
.content .callout-caution { --c: var(--caution); }
.content .callout-caution::before { content: "Caution"; }

/* The Docker command builder: a form whose output is the code blocks below it. */
.content .builder { border: 1px solid var(--border); border-radius: 10px; padding: 18px;
  background: var(--surface); margin: 0 0 20px; }
.content .builder-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.content .builder label { display: block; font-size: 14px; font-weight: 500; color: var(--text-strong); }
.content .builder input, .content .builder select {
  display: block; width: 100%; margin: 6px 0 4px; padding: 7px 10px; font-size: 13.5px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 6px; }
.content .builder input:focus, .content .builder select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.content .builder small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.45; }
.content .builder small code { font-size: 0.95em; }
.content .builder details { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; }
.content .builder details summary { padding: 8px 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
.content .builder details summary:hover { color: var(--text-strong); }
.content .builder details .builder-grid { padding: 0 12px 12px; }
.content .builder-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }

/* Section landing-page cards: a list of links wrapped in <div class="cards"> */
.content .cards ul { list-style: none; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.content .cards li { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  background: var(--surface); color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.content .cards li:hover { border-color: var(--brand); }
.content .cards li a { display: block; font-weight: 700; font-size: 16px; margin-bottom: 4px; }

/* Diagrams drawn as inline SVG */
.content figure { margin: 8px 0 28px; }
.content figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.diagram .box { fill: var(--surface); stroke: var(--border-strong); }
.diagram .box-brand { fill: var(--active-bg); stroke: var(--brand); }
.diagram .box-accent { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: var(--accent); }
.diagram text { fill: var(--text); font: 13px "DM Sans", sans-serif; }
.diagram .t-strong { fill: var(--text-strong); font-weight: 700; }
.diagram .t-muted { fill: var(--muted); font-size: 11.5px; }
.diagram .edge { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.diagram .edge-dash { stroke-dasharray: 4 4; }
.diagram .arrow { fill: var(--muted); }

/* Previous / next */
.pager { max-width: 780px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pager a { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; color: var(--text-strong); font-weight: 500; }
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager span { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pager-next { text-align: right; grid-column: 2; }
.footer { max-width: 780px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted); text-align: center; }

/* On this page */
.toc { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 32px 16px 32px 0; font-size: 13.5px; }
.toc-title { font-weight: 500; color: var(--text-strong); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); line-height: 1.4; }
.toc .toc-l3 a { padding-left: 24px; }
.toc a:hover { color: var(--text-strong); text-decoration: none; }
.toc a.current { color: var(--link); border-left-color: var(--link); }

.scrim { position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0, 0, 0, 0.45); z-index: 19; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .nav-toggle { display: inline-flex; }
  .version-badge, .topbar-links a { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .search { margin-left: 4px; flex: 1 1 0; min-width: 0; }
  .search-kbd { display: none; }
  .search input { padding-right: 10px; }
  .topbar-links { margin-left: 0; }
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: min(320px, 86vw); height: auto;
    z-index: 20; background: var(--bg); transform: translateX(-100%); transition: transform 0.2s; }
  body.nav-open .sidebar { transform: none; }
  .main { padding: 20px 16px 32px; }
}
@media (max-width: 520px) {
  .brand-docs { display: none; }
}
