/* =========================================================================
   ASLAN DOCUMENTATION — design system
   Premium monochrome base + refined cool accent, gradients & glows.
   ========================================================================= */

/* ----------------------------- Tokens ---------------------------------- */
:root {
  --accent: #eef1f8;
  --accent-2: #c2c7d4;
  --accent-3: #eef1f8;
  --accent-rgb: 236, 240, 248;

  --bg: #08090c;
  --bg-2: #0b0d12;
  --surface: rgba(255, 255, 255, 0.024);
  --surface-2: rgba(255, 255, 255, 0.04);
  --surface-3: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f3f4f7;
  --text-2: #b6bac6;
  --text-3: #818693;
  --text-faint: #5b6070;

  --code-bg: rgba(255, 255, 255, 0.05);
  --code-text: #e8eaf1;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .25), 0 8px 40px -8px rgba(var(--accent-rgb), .35);

  --sidebar-w: 286px;
  --toc-w: 240px;
  --content-max: 768px;
  --topbar-h: 60px;

  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo,
          Consolas, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="light"] {
  --accent: #181b22;
  --accent-2: #3f444f;
  --accent-3: #181b22;
  --accent-rgb: 24, 27, 34;

  --bg: #f7f8fb;
  --bg-2: #eef1f7;
  --surface: rgba(10, 12, 20, 0.018);
  --surface-2: rgba(10, 12, 20, 0.035);
  --surface-3: rgba(10, 12, 20, 0.05);
  --border: rgba(10, 14, 30, 0.09);
  --border-2: rgba(10, 14, 30, 0.13);
  --border-strong: rgba(10, 14, 30, 0.2);

  --text: #10131c;
  --text-2: #3f4658;
  --text-3: #646b80;
  --text-faint: #8b91a3;

  --code-bg: rgba(10, 14, 30, 0.05);
  --code-text: #2b2f38;

  --shadow: 0 12px 30px -14px rgba(20, 24, 50, .25);
  --shadow-lg: 0 30px 60px -24px rgba(20, 24, 50, .28);
}

/* ----------------------------- Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01", "cv11";
  overflow-x: hidden;
}

::selection { background: rgba(var(--accent-rgb), .9); color: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

svg { width: 1em; height: 1em; flex-shrink: 0; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ----------------------- Background effects ---------------------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx__glow { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .5; }
.bg-fx__glow--1 {
  width: 720px; height: 720px; top: -340px; left: -200px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .18), transparent 65%);
}
.bg-fx__glow--2 {
  width: 620px; height: 620px; bottom: -300px; right: -180px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .12), transparent 65%);
}
html[data-theme="light"] .bg-fx__glow { opacity: .35; }
.bg-fx__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 100% 70% at 50% 0%, #000 0%, transparent 75%);
  opacity: .5;
}

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

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%), var(--bg);
  backdrop-filter: blur(8px);
  z-index: 60;
}
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.2)); }

.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* --------------------------- Brand / sidebar top ----------------------- */
.sidebar__top {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand__logo {
  height: 23px; width: auto; display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .45));
}
html[data-theme="light"] .brand__logo { filter: invert(1); }
.brand__sub {
  font-size: 9px; letter-spacing: .18em; font-weight: 700; text-transform: uppercase;
  color: var(--accent); line-height: 1; align-self: center;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(var(--accent-rgb), .12);
  border: 1px solid rgba(var(--accent-rgb), .22);
}

/* ----------------------------- Search trigger -------------------------- */
.search-trigger {
  margin: 16px 16px 8px; padding: 9px 12px;
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 32px);
  background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-size: 13.5px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface-3); color: var(--text-2); }
.search-trigger__ic { font-size: 15px; color: var(--text-3); }
.search-trigger__kbd {
  margin-left: auto; display: inline-flex; align-items: center; gap: 1px;
  font-family: var(--font); font-size: 11px; color: var(--text-3);
  padding: 2px 6px; border: 1px solid var(--border-2); border-radius: 6px;
  background: var(--surface);
}
.search-trigger__kbd span { font-size: 12px; }

/* ----------------------------- Nav ------------------------------------- */
.sidebar__scroll { flex: 1; overflow-y: auto; padding: 8px 12px 24px; }
.nav__group { margin-bottom: 22px; }
.nav__heading {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); padding: 6px 10px; margin-bottom: 4px;
}
.nav__heading-ic { font-size: 15px; color: var(--text-2); opacity: .85; }
.nav__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 11px 7px 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14px; line-height: 1.35;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav__dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-faint); transition: all .18s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.nav__link:hover .nav__dot { background: var(--text-3); }
.nav__link.is-active {
  color: var(--text); font-weight: 550;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .14), rgba(var(--accent-rgb), .03));
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .14);
}
.nav__link.is-active .nav__dot {
  background: var(--accent); box-shadow: 0 0 10px 1px rgba(var(--accent-rgb), .8);
}
.nav__link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px 1px rgba(var(--accent-rgb), .7);
}

.sidebar__foot { flex-shrink: 0; padding: 12px 18px; border-top: 1px solid var(--border); }
.sidebar__foot-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.sidebar__foot-link:hover { color: var(--accent); }
.sidebar__close { display: none; }

/* ----------------------------- Topbar ---------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); min-width: 0; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb__sep { font-size: 13px; opacity: .6; display: inline-flex; }
.breadcrumb__cur { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-size: 17px; cursor: pointer;
  transition: all .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.theme-toggle__moon { display: none; }
html[data-theme="light"] .theme-toggle__sun { display: none; }
html[data-theme="light"] .theme-toggle__moon { display: inline-flex; }

.topbar__menu { display: none; }
.search-trigger--compact { display: none; width: 36px; height: 36px; padding: 0; margin: 0; justify-content: center; border-radius: 9px; }
.search-trigger--compact span { display: none; }

/* ----------------------------- Main / article -------------------------- */
.main {
  flex: 1; width: 100%;
  display: flex; gap: 56px;
  max-width: calc(var(--content-max) + var(--toc-w) + 56px + 80px);
  margin: 0 auto; padding: 52px 40px 80px;
}
.article { flex: 1; min-width: 0; max-width: var(--content-max); }
.article__eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.article__eyebrow::before {
  content: ""; width: 18px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent);
}
.article__title {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.85rem);
  line-height: 1.08; font-weight: 700; letter-spacing: -.025em;
  margin-bottom: 26px;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 62%, var(--text-3)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.article__body { font-size: 16px; color: var(--text-2); }
.article__body > *:first-child { margin-top: 0; }

/* prose */
.article__body p { margin: 0 0 18px; }
.article__body h2, .article__body h3, .article__body h4 {
  color: var(--text); font-weight: 650; letter-spacing: -.015em;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
  position: relative;
}
.article__body h2 {
  font-size: 1.55rem; margin: 46px 0 16px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.article__body h3 { font-size: 1.22rem; margin: 32px 0 12px; }
.article__body h4 { font-size: 1.05rem; margin: 26px 0 10px; }
.article__body .anchor {
  opacity: 0; margin-left: 8px; font-size: .75em; color: var(--text-faint);
  transition: opacity .15s, color .15s; vertical-align: middle;
}
.article__body h2:hover .anchor, .article__body h3:hover .anchor, .article__body h4:hover .anchor { opacity: 1; }
.article__body .anchor:hover { color: var(--accent); }

.article__body a:not(.card):not(.pager__link) {
  color: var(--accent); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(var(--accent-rgb), .4);
  transition: text-decoration-color .2s var(--ease), color .15s;
}
.article__body a:not(.card):not(.pager__link):hover { text-decoration-color: var(--accent); }
.ext-ic { font-size: .72em; opacity: .65; margin-left: 2px; vertical-align: super; }

.article__body strong { color: var(--text); font-weight: 650; }
.article__body ul, .article__body ol { margin: 0 0 18px; padding-left: 4px; list-style: none; }
.article__body li { position: relative; padding-left: 26px; margin-bottom: 9px; }
.article__body ul > li::before {
  content: ""; position: absolute; left: 6px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: .8;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), .5);
}
.article__body ol { counter-reset: ol; }
.article__body ol > li { counter-increment: ol; }
.article__body ol > li::before {
  content: counter(ol); position: absolute; left: 0; top: 1px;
  width: 19px; height: 19px; border-radius: 6px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; color: var(--accent);
  background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .22);
}
.article__body li > ul, .article__body li > ol { margin: 9px 0 0; }

.article__body code {
  font-family: var(--mono); font-size: .87em;
  background: var(--code-bg); color: var(--code-text);
  padding: .15em .42em; border-radius: 6px; border: 1px solid var(--border);
}
.article__body hr { border: none; height: 1px; background: var(--border); margin: 40px 0; }

.article__body blockquote {
  margin: 0 0 18px; padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent); color: var(--text-2);
  font-style: italic;
}
.muted { color: var(--text-3); }

/* ----------------------------- Code block ------------------------------ */
.code-block { position: relative; margin: 0 0 22px; }
.code-block pre {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.code-block pre code {
  font-family: var(--mono); font-size: 13.5px; color: var(--text);
  background: none; border: none; padding: 0; line-height: 1.6;
}
.code-copy {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-3); color: var(--text-3); cursor: pointer;
  font-size: 14px; opacity: 0; transition: all .15s var(--ease);
}
.code-block:hover .code-copy { opacity: 1; }
.code-copy:hover { color: var(--text); border-color: var(--border-strong); }
.code-copy svg:last-child { display: none; color: var(--accent-3); }
.code-copy.copied svg:first-child { display: none; }
.code-copy.copied svg:last-child { display: block; }

/* ----------------------------- Figures --------------------------------- */
.doc-figure { margin: 8px 0 26px; }
.doc-figure__frame {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-2);
  box-shadow: var(--shadow);
  position: relative;
}
.doc-figure__frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.doc-figure img { width: 100%; cursor: zoom-in; transition: transform .4s var(--ease); display: block; }
.doc-figure__frame:hover img { transform: scale(1.015); }
.doc-figure figcaption {
  margin-top: 12px; font-size: 13.5px; color: var(--text-3); text-align: center;
}

/* ----------------------------- Callouts -------------------------------- */
.callout {
  display: flex; gap: 14px; margin: 0 0 22px;
  padding: 15px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2);
  position: relative; overflow: hidden;
}
.callout::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.callout__icon { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.callout__body { color: var(--text-2); font-size: 14.5px; }
.callout__body p { margin: 0; }
.callout--info::before { background: var(--accent); }
.callout--info { background: rgba(var(--accent-rgb), .07); border-color: rgba(var(--accent-rgb), .2); }
.callout--info .callout__icon { color: var(--accent); }
.callout--warning::before { background: #f5a623; }
.callout--warning { background: rgba(245, 166, 35, .07); border-color: rgba(245, 166, 35, .22); }
.callout--warning .callout__icon { color: #f5a623; }
.callout--danger::before { background: #ff5c5c; }
.callout--danger { background: rgba(255, 92, 92, .07); border-color: rgba(255, 92, 92, .22); }
.callout--danger .callout__icon { color: #ff6b6b; }
.callout--success::before { background: #34d399; }
.callout--success { background: rgba(52, 211, 153, .07); border-color: rgba(52, 211, 153, .22); }
.callout--success .callout__icon { color: #34d399; }

/* ----------------------------- Stepper --------------------------------- */
.stepper { list-style: none; padding: 0; margin: 6px 0 26px; counter-reset: none; }
.stepper .step { position: relative; display: flex; gap: 18px; padding: 0 0 26px; }
.stepper .step::before {
  content: ""; position: absolute; left: 17px; top: 36px; bottom: -2px; width: 1px;
  background: linear-gradient(var(--border-strong), var(--border));
}
.stepper .step:last-child { padding-bottom: 0; }
.stepper .step:last-child::before { display: none; }
.step__marker {
  flex-shrink: 0; width: 35px; height: 35px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--bg);
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  position: relative; z-index: 1;
}
.step__body { padding-top: 3px; }
.step__title { color: var(--text); font-weight: 650; font-size: 1.05rem; margin-bottom: 4px; letter-spacing: -.01em; }
.step__body p { margin: 0; color: var(--text-2); }
.step__body a { color: var(--accent); }

/* ----------------------------- Cards ----------------------------------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin: 8px 0 28px;
}
.card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; transition: transform .22s var(--ease), border-color .22s, background .22s;
  isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(120% 120% at 0% 0%, rgba(var(--accent-rgb), .12), transparent 55%);
  transition: opacity .25s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .35); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 10px;
  border-radius: 11px; font-size: 20px; color: var(--accent);
  background: linear-gradient(145deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .06));
  border: 1px solid rgba(var(--accent-rgb), .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.card__title { color: var(--text); font-weight: 650; font-size: 1.06rem; letter-spacing: -.01em; }
.card__desc { color: var(--text-3); font-size: 13.8px; line-height: 1.55; }
.card__arrow {
  margin-top: 12px; font-size: 17px; color: var(--text-faint);
  transition: transform .22s var(--ease), color .22s;
}
.card:hover .card__arrow { color: var(--accent); transform: translateX(4px); }

/* ----------------------------- Tables ---------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-wrap th, .table-wrap td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table-wrap th { color: var(--text); font-weight: 600; background: var(--surface-2); font-size: 13px; letter-spacing: .02em; }
.table-wrap td { color: var(--text-2); }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background .12s; }
.table-wrap tbody tr:hover { background: var(--surface); }

/* ----------------------------- Pager ----------------------------------- */
.pager { display: flex; gap: 16px; margin-top: 56px; padding-top: 12px; }
.pager__link {
  flex: 1; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: all .2s var(--ease);
}
.pager__link--next { justify-content: flex-end; text-align: right; }
.pager__link:hover { border-color: rgba(var(--accent-rgb), .35); background: var(--surface-2); transform: translateY(-2px); }
.pager__ic { font-size: 18px; color: var(--text-3); transition: color .2s, transform .2s; }
.pager__link:hover .pager__ic { color: var(--accent); }
.pager__link--prev:hover .pager__ic { transform: translateX(-3px); }
.pager__link--next:hover .pager__ic { transform: translateX(3px); }
.pager__meta { display: flex; flex-direction: column; min-width: 0; }
.pager__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.pager__title { color: var(--text); font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----------------------------- Article footer -------------------------- */
.article__foot {
  margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: 13px; color: var(--text-3);
}
.article__foot-brand { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.article__foot-brand img { width: 16px; height: 16px; }
html[data-theme="light"] .article__foot-brand img { filter: invert(1); }
.article__foot-links { display: flex; gap: 18px; margin-left: auto; }
.article__foot-links a { color: var(--text-3); }
.article__foot-links a:hover { color: var(--accent); }
.article__foot-copy { width: 100%; color: var(--text-faint); font-size: 12px; }

/* ----------------------------- TOC ------------------------------------- */
.toc { width: var(--toc-w); flex-shrink: 0; }
.no-toc .toc { display: none; }
.toc__inner { position: sticky; top: calc(var(--topbar-h) + 40px); }
.toc__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); margin-bottom: 12px;
}
.toc__list { list-style: none; padding: 0; border-left: 1px solid var(--border); }
.toc__item a {
  display: block; padding: 5px 0 5px 16px; margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-3); font-size: 13px; line-height: 1.45;
  transition: color .15s, border-color .15s;
}
.toc__item--h3 a { padding-left: 28px; font-size: 12.5px; }
.toc__item a:hover { color: var(--text); }
.toc__item a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 550; }

/* ----------------------- Scroll progress bar --------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 120; box-shadow: 0 0 10px rgba(var(--accent-rgb), .7);
  transition: width .1s linear;
}

/* ----------------------------- Search modal ---------------------------- */
.search-modal { position: fixed; inset: 0; z-index: 300; display: none; }
.search-modal.is-open { display: block; }
.search-modal__backdrop {
  position: absolute; inset: 0; background: rgba(2, 3, 6, .6);
  backdrop-filter: blur(4px); animation: fade .15s var(--ease);
}
.search-modal__panel {
  position: relative; max-width: 600px; margin: 12vh auto 0;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(var(--accent-rgb), .06);
  overflow: hidden; animation: pop .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.search-modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.search-modal__ic { font-size: 18px; color: var(--text-3); }
.search-modal__input { flex: 1; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 16px; }
.search-modal__input::placeholder { color: var(--text-faint); }
.search-modal__esc { font-size: 11px; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 7px; }
.search-modal__results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-result {
  display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; border-radius: var(--radius);
  cursor: pointer; border: 1px solid transparent;
}
.search-result.is-active, .search-result:hover { background: var(--surface-2); border-color: var(--border); }
.search-result__sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.search-result__title { color: var(--text); font-weight: 600; font-size: 14.5px; }
.search-result__snippet { color: var(--text-3); font-size: 13px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-result mark { background: rgba(var(--accent-rgb), .25); color: var(--text); border-radius: 3px; padding: 0 2px; }
.search-empty { padding: 36px 18px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-modal__foot {
  display: flex; gap: 18px; padding: 11px 18px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.search-modal__foot kbd { font-family: var(--font); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 6px; margin-right: 3px; font-size: 11px; }

/* ----------------------------- Lightbox -------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 400; display: none;
  background: rgba(2, 3, 6, .9); backdrop-filter: blur(8px);
  place-items: center; padding: 5vh 5vw; cursor: zoom-out;
}
.lightbox.is-open { display: grid; animation: fade .2s var(--ease); }
.lightbox img { max-width: 100%; max-height: 90vh; width: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border-2); }

/* ----------------------- Reveal on scroll ------------------------------ */
.article__body > * { opacity: 1; }
html.js .reveal { opacity: 0; transform: translateY(12px); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1 !important; transform: none !important; } }

/* ----------------------------- Sidebar overlay ------------------------- */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(2, 3, 6, .5); backdrop-filter: blur(2px); z-index: 55; }

/* ============================ Responsive ============================== */
@media (max-width: 1240px) {
  .toc { display: none; }
  .main { max-width: calc(var(--content-max) + 80px); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 300px; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .28s var(--ease); box-shadow: var(--shadow-lg);
    width: var(--sidebar-w);
  }
  .sidebar.is-open { transform: none; }
  .sidebar-overlay.is-open { display: block; }
  .sidebar__close { display: grid; }
  .topbar__menu { display: grid; }
  .search-trigger--compact { display: grid; }
}

@media (max-width: 680px) {
  .main { padding: 32px 20px 64px; }
  .article__title { margin-bottom: 18px; }
  .pager { flex-direction: column; }
  .breadcrumb a:first-child { display: none; }
  .breadcrumb__sep:first-of-type { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .search-modal__panel { margin: 8vh 12px 0; }
}
