/* docs.olan.app: Olan palette (design-system tokens: neutral grays, mint accent #00ce9d). */
:root {
  --bg: #ffffff;
  --bg-raised: #fbfafb;
  --bg-code: #f5f5f5;
  --bg-hover: rgb(24 24 27 / 6%);
  --fg: #18181b;
  --fg-body: #3f3f46;
  --fg-muted: #6b6b73;
  --border: rgb(24 24 27 / 8%);
  --border-strong: #d6d6d8;
  --accent: #00ce9d;
  --accent-strong: #00936f;
  --accent-tint: rgb(0 206 157 / 11%);
  --on-accent: #06281f;
  --radius: 10px;
  --sidebar: 260px;
  --topbar: 56px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181818;
    --bg-raised: #202020;
    --bg-code: #1f1f1f;
    --bg-hover: rgb(255 255 255 / 7%);
    --fg: #ededef;
    --fg-body: #c8c8cc;
    --fg-muted: #8a8a8f;
    --border: rgb(255 255 255 / 9%);
    --border-strong: #383838;
    --accent-strong: #5ff0c8;
    --accent-tint: rgb(0 206 157 / 13%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-body);
  font: 16px/1.65 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar); padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-sub { color: var(--fg-muted); font-weight: 500; }
.logo { height: 24px; width: auto; display: block; }
.logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-on-light { display: none; }
  .logo-on-dark { display: block; }
}
.top-links { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.top-links a { color: var(--fg-muted); }
.top-links a:hover { color: var(--fg); text-decoration: none; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--topbar); align-self: start;
  height: calc(100vh - var(--topbar)); overflow-y: auto;
  padding: 24px 16px 40px; border-right: 1px solid var(--border);
}
.nav-label { margin: 20px 10px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-muted); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--fg-body); font-size: 14.5px; line-height: 1.4; }
.nav-list a:hover { background: var(--bg-hover); text-decoration: none; color: var(--fg); }
.nav-list a[aria-current="page"] { background: var(--accent-tint); color: var(--fg); font-weight: 600; }
.content { min-width: 0; padding: 40px 48px 64px; }
.doc { max-width: 820px; }

/* Mobile navigation (CSS only) */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-button { display: none; width: 36px; height: 36px; margin-left: -6px; border-radius: 8px; cursor: pointer; align-items: center; justify-content: center; }
.menu-button span, .menu-button span::before, .menu-button span::after { display: block; width: 18px; height: 2px; background: var(--fg); border-radius: 2px; position: relative; content: ""; }
.menu-button span::before { position: absolute; top: -6px; }
.menu-button span::after { position: absolute; top: 6px; }
.nav-toggle:focus-visible + .topbar .menu-button { outline: 2px solid var(--accent); }

@media (max-width: 860px) {
  .shell { display: block; }
  .menu-button { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 15;
    width: min(85vw, 320px); height: auto; padding-top: calc(var(--topbar) + 16px); background: var(--bg-raised);
    transform: translateX(-100%); transition: transform 0.2s ease;
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 35%); }
  .content { padding: 28px 16px 48px; }
  .brand-sub { display: none; }
}

/* Article */
.doc h1, .doc h2, .doc h3, .doc h4 { color: var(--fg); line-height: 1.25; letter-spacing: -0.015em; }
.doc h1 { font-size: 2.1rem; margin: 0 0 1rem; }
.doc h2 { font-size: 1.45rem; margin: 2.4rem 0 0.8rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.doc h3 { font-size: 1.15rem; margin: 1.8rem 0 0.6rem; }
.doc h4 { font-size: 1rem; margin: 1.4rem 0 0.5rem; }
.anchor { margin-left: 6px; color: var(--fg-muted); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
.doc p, .doc ul, .doc ol { margin: 0 0 1rem; }
.doc li + li { margin-top: 0.25rem; }
.doc strong { color: var(--fg); }
.doc blockquote { margin: 0 0 1rem; padding: 0.6rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius) var(--radius) 0; }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

code { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { padding: 0.12em 0.38em; border-radius: 6px; background: var(--bg-code); border: 1px solid var(--border); overflow-wrap: anywhere; }
a > code { color: var(--accent-strong); }
pre {
  margin: 0 0 1.2rem; padding: 14px 16px; overflow-x: auto;
  background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; line-height: 1.55; tab-size: 2;
}
pre code { font-size: inherit; color: var(--fg); }

.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--fg); background: var(--bg-raised); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Landing */
.hero { margin-bottom: 2.5rem; }
.eyebrow { margin: 0 0 0.5rem; color: var(--accent-strong); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.lead { font-size: 1.12rem; color: var(--fg-body); }
.quickstart { margin: 1.4rem 0; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4rem 0 1.8rem; }
.button { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px; }
.button:hover { text-decoration: none; filter: brightness(1.05); }
.button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--border-strong); }

.footer { max-width: 820px; margin-top: 4rem; padding-top: 1.2rem; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 14px; }
.footer p { margin: 0 0 0.5rem; }
