/* ============================================================
   Lyap documentation — design system
   Minimal, elegant, responsive. Light/dark with system default.
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #18181b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --accent: #0f6ab8;
  --accent-strong: #0b54a0;
  --accent-soft: #e8f2fc;
  --accent-contrast: #ffffff;
  --code-bg: #111318;
  --code-text: #d4d7de;
  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.14);
  --overlay: rgba(24, 24, 27, 0.45);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-soft: #0f1216;
  --bg-muted: #171a20;
  --border: #23262d;
  --border-strong: #343942;
  --text: #f2f3f5;
  --text-2: #c7cad1;
  --text-3: #9297a1;
  --accent: #58a6e8;
  --accent-strong: #7ec0f2;
  --accent-soft: rgba(88, 166, 232, 0.13);
  --accent-contrast: #0b0d10;
  --code-bg: #0a0c0f;
  --code-text: #d4d7de;
  --header-bg: rgba(11, 13, 16, 0.82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
  --overlay: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  color-scheme: light;
  --code-bg: #f6f8fa;
  --code-text: #24292f;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: inline-block;
  vertical-align: middle;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-strong);
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3, h4 {
  scroll-margin-top: 88px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

[hidden] {
  display: none !important;
}

/* ---------- Layout shell ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
  margin-right: 6px;
}
.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.nav-links a {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  border-radius: 9px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-muted);
}
.nav-icon-btn svg {
  width: 17px;
  height: 17px;
}

.menu-btn {
  display: none;
}

/* Theme dropdown */
.theme-toggle {
  position: relative;
}

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  min-width: 168px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 110;
}
.theme-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.theme-menu-item:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.theme-menu-item.selected {
  color: var(--accent);
  background: var(--accent-soft);
}
.theme-menu-item svg {
  width: 15px;
  height: 15px;
}
.theme-menu-item .check {
  margin-left: auto;
  width: 14px;
  height: 14px;
}

/* Sun / moon icon switch based on effective theme */
[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
  display: none;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  align-items: flex-start;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 20px 72px;
  gap: 48px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 140;
}
@media (min-width: 1024px) {
  .drawer-backdrop {
    display: none !important;
  }
}

/* Sidebar (drawer on mobile) */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 288px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 150;
  padding: 24px 16px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group {
  margin: 18px 10px 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.nav-group:first-child {
  margin-top: 0;
}

.nav-link {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  transition: color 0.12s, background 0.12s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-muted);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 72px;
    width: 256px;
    flex-shrink: 0;
    height: calc(100vh - 88px);
    max-height: calc(100vh - 88px);
    background: transparent;
    border-right: none;
    padding: 8px 12px 32px 0;
    transform: none;
    box-shadow: none;
    z-index: 10;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  margin: 0 auto;
}

.doc {
  padding: 8px 0 32px;
}

/* TOC */
.toc {
  display: none;
  width: 236px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0 24px;
  z-index: 10;
}
.toc-title {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.toc-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
  margin-left: 2px;
}
.toc-link {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.5;
  transition: color 0.12s, border-color 0.12s;
}
.toc-link.sub {
  padding-left: 24px;
}
.toc-link:hover {
  color: var(--text);
}
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
@media (min-width: 1280px) {
  .toc {
    display: block;
  }
}

/* ---------- Content typography ---------- */
.doc h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
}
.doc h2 {
  font-size: 22px;
  font-weight: 650;
  margin: 40px 0 12px;
}
.doc h3 {
  font-size: 17.5px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.doc p {
  margin: 12px 0;
}
.doc p.lead {
  font-size: 17px;
  color: var(--text-2);
  margin: 0 0 20px;
}

.doc ul,
.doc ol {
  margin: 12px 0;
  padding-left: 22px;
}
.doc li {
  margin: 5px 0;
}
.doc li > ul {
  margin: 4px 0;
}

.doc strong {
  font-weight: 600;
}

.doc a code,
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 5.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.doc h1 code,
.doc h2 code,
.doc h3 code {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  white-space: normal;
}

/* ---------- Code blocks ---------- */
.doc-code {
  position: relative;
  margin: 18px 0 24px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-text);
}
.doc-code[data-title] {
  padding-top: 42px;
}
.doc-code::before {
  content: attr(data-title);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  font-family: inherit;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.doc-code code {
  display: block;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: none;
  white-space: pre;
  tab-size: 2;
}
.doc-code code::-webkit-scrollbar {
  height: 8px;
}
.doc-code code::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
.doc-code code::-webkit-scrollbar-track {
  background: transparent;
}

/* Token colors (dark by default, light variants below) */
.tok-com { color: #7d8492; font-style: italic; }
.tok-str { color: #9ece6a; }
.tok-num { color: #ff9e64; }
.tok-kw  { color: #bb9af7; }
.tok-fn  { color: #7aa2f7; }
.tok-tag { color: #f7768e; }
.tok-attr { color: #73daca; }
.tok-op  { color: #89ddff; }

[data-theme="light"] .tok-com  { color: #6e7781; }
[data-theme="light"] .tok-str  { color: #0a7c4f; }
[data-theme="light"] .tok-num  { color: #b35900; }
[data-theme="light"] .tok-kw   { color: #8250df; }
[data-theme="light"] .tok-fn   { color: #0550ae; }
[data-theme="light"] .tok-tag  { color: #cf222e; }
[data-theme="light"] .tok-attr { color: #0a7c4f; }
[data-theme="light"] .tok-op   { color: #0550ae; }

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-color: var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 14px;
  color: var(--text-2);
}
.callout .callout-icon {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--accent);
}
.callout strong {
  color: var(--text);
  font-weight: 600;
}
.callout p {
  margin: 0;
}
.callout.warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.09);
}
.callout.warn .callout-icon {
  color: #f59e0b;
}
.callout.danger {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.callout.danger .callout-icon {
  color: #ef4444;
}

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.06s, box-shadow 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text-2);
  background: var(--bg);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.btn-sm {
  padding: 5px 11px;
  font-size: 13px;
  border-radius: 7px;
}
.btn-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.badge-accent {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ---------- Tables ---------- */
.doc-table {
  width: 100%;
  margin: 18px 0 24px;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
}
.doc-table th {
  text-align: left;
  background: var(--bg-soft);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-2);
}
.doc-table tr:last-child td {
  border-bottom: none;
}
.doc-table td:first-child {
  white-space: nowrap;
}
.doc-table td code,
.doc-table th code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.doc-table td strong {
  color: var(--text);
}

/* ---------- Hero (landing) ---------- */
.hero {
  text-align: center;
  padding: 72px 0 48px;
}
.hero .hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 750;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #409fbf, #4080bf 55%, #6a6fd8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.tagline {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--text-2);
  max-width: 640px;
  margin: 0 auto 30px;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-demo {
  max-width: 680px;
  margin: 0 auto;
}

.hero-warning {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 16px 20px;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
}
.hero-warning strong {
  display: block;
  margin-bottom: 3px;
  color: #f59e0b;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 48px 0 8px;
}
.feature-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  padding: 22px 20px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.feature-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card .f-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.feature-card .f-icon svg {
  width: 17px;
  height: 17px;
}
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
}
.feature-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------- Live example panels ---------- */
.example {
  margin: 20px 0 26px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  overflow: hidden;
}
.example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.example-body {
  padding: 22px 20px;
}
.example-body p {
  margin: 6px 0;
}
.example-body label {
  font-size: 14px;
  color: var(--text-2);
}

/* Form controls used in examples */
.field {
  margin: 0 0 14px;
}
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .error-text {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: #ef4444;
}
.field .hint {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-3);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 18px;
  font-size: 14px;
  color: var(--text-2);
}
.check-row input {
  accent-color: var(--accent);
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-2);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch .track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s;
}
.switch input:checked + .track {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked + .track::after {
  transform: translateX(18px);
}

/* Progress / meter */
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #409fbf, #4080bf);
  transition: width 0.25s ease;
}

/* ---------- Pagination ---------- */
.pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 48px 0 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.page-link {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-soft);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.page-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.page-link.next {
  text-align: right;
}
.page-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.page-link.next .page-label {
  justify-content: flex-end;
}
.page-title {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 24px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
}
.footer a {
  color: var(--text-2);
}
.footer a:hover {
  color: var(--accent);
}

/* ---------- Utilities ---------- */
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wrap {
  flex-wrap: wrap;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .menu-btn {
    display: inline-flex;
  }
  .nav-links {
    display: none;
  }
  .layout {
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    padding: 0 14px;
  }
  .layout {
    padding: 16px 16px 56px;
    gap: 0;
  }
  .doc h1 {
    font-size: 26px;
  }
  .doc h2 {
    font-size: 19px;
  }
  .pagination {
    grid-template-columns: 1fr;
  }
  .page-link.next {
    text-align: left;
  }
  .page-link.next .page-label {
    justify-content: flex-start;
  }
  .hero {
    padding: 48px 0 32px;
  }
  .doc-code {
    font-size: 12.5px;
  }
}