/* ══════════════════════════════════════════════════════════════ */
/* Shared docs styles — linked by all /docs pages               */
/* ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables (dark — default) ──────────────────────────────── */
:root {
  --bg:               #1b1d1e;
  --bg-translucent:   rgba(28, 28, 28, 0.85);
  --surface:          #2c2f36;
  --surface-2:        #292929;
  --border:           #747690;
  --accent:           #3dad9a;
  --accent-dim:       rgba(61,173,165,0.12);
  --accent2:          #6c1395;
  --purple:           #a52cdd;
  --text:             #bcbac4;
  --sub:              #8b929e;
  --code-bg:          #1a1f28;
  --toc-link:         #a9b5ca;
  --scrollbar-accent: #3ef6cf;
  --success:          #57b57a;
  --warn:             #d4953a;
  --rail-gradient:    linear-gradient(
    180deg,
    transparent 0px,
    color-mix(in srgb, var(--accent2) 82%, transparent) 20px,
    color-mix(in srgb, var(--accent) 58%, transparent) 20%,
    color-mix(in srgb, var(--accent2) 70%, transparent) 44%,
    color-mix(in srgb, var(--accent) 50%, transparent) 68%,
    color-mix(in srgb, var(--accent2) 82%, transparent) 88%
  );
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  background: #0a0d13;
  color: var(--text);
  position: relative;
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0),
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 36px);
  background-size: 26px 26px, 100% 100%;
  opacity: 0.16;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(900px 540px at 12% 18%, rgba(47, 210, 255, 0.18), transparent 60%),
    radial-gradient(700px 520px at 85% 10%, rgba(52, 217, 161, 0.17), transparent 62%),
    radial-gradient(900px 700px at 78% 82%, rgba(103, 241, 198, 0.11), transparent 70%),
    linear-gradient(120deg, rgba(47, 210, 255, 0.09), transparent 55%),
    linear-gradient(200deg, rgba(52, 217, 161, 0.07), transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 33%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 33%);
  pointer-events: none;
  z-index: -1;
}

/* ── Ambient background orbs ─────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(47, 210, 255, 0.34), rgba(52, 217, 161, 0.15) 55%, transparent 72%);
  opacity: 0.6;
  filter: blur(18px);
  mix-blend-mode: screen;
  animation: orbFloat 18s ease-in-out infinite;
}

.orb-1 { width: 340px; height: 340px; top: -80px;  left: -120px; }
.orb-2 { width: 260px; height: 260px; top: 140px;  right: -100px; animation-delay: -6s; }
.orb-3 { width: 420px; height: 420px; bottom: -180px; left: 20%;  animation-delay: -2s; }
.orb-4 { width: 200px; height: 200px; bottom: 120px;  right: 12%; animation-delay: -10s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(12px, -18px); }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 15px;
  height: 15px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 0 8px;
}

::-webkit-scrollbar-button {
  display: none;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--scrollbar-accent) 55%, black);
  border-radius: 0 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 1px 1px 0 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 0 rgba(0, 0, 0, 0.15),
    inset -1px -1px 0 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.15);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-accent);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 1px 1px 0 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 0 rgba(0, 0, 0, 0.22),
    inset 3px 3px 0 0 rgba(0, 0, 0, 0.14),
    inset -1px -1px 0 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.22),
    inset -3px -3px 0 0 rgba(0, 0, 0, 0.14);
}

/* ── Typography ──────────────────────────────────────────────── */
h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 44px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 96px;
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
  scroll-margin-top: 96px;
}

h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-top: 22px;
  margin-bottom: 8px;
  scroll-margin-top: 96px;
}

p { margin-bottom: 12px; }

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

strong { font-weight: 600; color: var(--text); }

/* ── Lists ───────────────────────────────────────────────────── */
ol, ul {
  margin: 10px 0 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
}

li > p { margin-bottom: 6px; }

/* ── Code ────────────────────────────────────────────────────── */
code {
  font-family: 'Consolas', 'Cascadia Code', 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 12px 0 18px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.code-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
  margin-bottom: 6px;
}

/* ── kbd ─────────────────────────────────────────────────────── */
kbd {
  font-family: 'Consolas', 'Cascadia Code', 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), inset 0 0 0 1px rgba(255,255,255,0.03);
  color: var(--text);
}

/* ── Info boxes ──────────────────────────────────────────────── */
.info-box {
  padding: 14px 18px;
  margin: 16px 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.info-box.tip {
  border-left: 3px solid var(--accent);
}

.info-box.warn {
  border-left: 3px solid var(--warn);
}

.info-box.note {
  border-left: 3px solid var(--purple);
}

.info-box p:last-child { margin-bottom: 0; }

.info-box .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.info-box.tip .label { color: var(--accent); }
.info-box.warn .label { color: var(--warn); }
.info-box.note .label { color: var(--purple); }

/* ── MCP URL box ─────────────────────────────────────────────── */
.mcp-url-box {
  margin: 16px 0 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.mcp-url-box .label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
  margin-bottom: 6px;
}

.mcp-url-box code {
  font-size: 15px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
}

/* ── Tier badges ─────────────────────────────────────────────── */
.tier {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--purple);
  border: 1px solid rgba(123, 74, 158, 0.4);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 2px;
  vertical-align: middle;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tier a,
.tier a:hover {
  color: inherit;
  text-decoration: none;
}

.tier-inline {
  color: var(--purple);
  text-decoration: none;
}

.tier-inline:hover {
  text-decoration: underline;
}

/* ── Table ───────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 14px;
}

th {
  text-align: left;
  font-weight: 600;
  color: var(--sub);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* ── Divider ─────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── Doc header ──────────────────────────────────────────────── */
.doc-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.doc-header a {
  color: var(--sub);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.doc-header a:hover { color: var(--accent); }

.doc-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 8px;
}

.doc-header .subtitle {
  color: var(--sub);
  font-size: 15px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.doc-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--sub);
  font-size: 13px;
}

/* ── Highlight ───────────────────────────────────────────────── */
mark.doc-highlight {
  background: rgba(61, 159, 142, 0.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Theme toggle ────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 44px;
  right: 26px;
  z-index: 200;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, #a52cdd 50%, transparent);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a52cdd;
  outline: none;
  transition: box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle:hover {
  border-color: #a52cdd;
  color: var(--text);
  box-shadow:
    0 0 9px color-mix(in srgb, #a52cdd 60%, transparent),
    inset 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ── Sticky toggle bar (single-column pages) ─────────────────── */
.sticky-toggle-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 12px 0 8px;
}

.sticky-toggle-bar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 5px;
  background: linear-gradient(var(--bg), transparent);
  pointer-events: none;
}

.sticky-toggle-bar .theme-toggle {
  position: static;
}

/* ── Gradient border rails ─────────────────────────────────── */
/* Applied per-element via layered backgrounds + transparent side borders.
   Use: background: var(--rail-gradient) left/1px 100% no-repeat border-box,
                     var(--rail-gradient) right/1px 100% no-repeat border-box,
                     <bg-color> padding-box;
        border-left-color: transparent; border-right-color: transparent; */

/* ── Light mode ──────────────────────────────────────────────── */
body.light-mode {
  --bg:               #d9d1bd;
  --bg-translucent:   rgba(217, 209, 189, 0.85);
  --surface:          #ccbea1;
  --surface-2:        #c5b999;
  --border:           #535166;
  --accent:           #a93e00;
  --accent-dim:       rgba(237,111,38,0.12);
  --accent2:          #69611a;
  --text:             #333333;
  --sub:              #5a5a5a;
  --code-bg:          #c2b89e;
  --toc-link:         #3b2f2f;
  --scrollbar-accent: #cf682c;
  --success:          #3d8a56;
  --warn:             #b07a2a;
}

body.light-mode mark.doc-highlight {
  background: rgba(237, 111, 38, 0.25);
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-accent);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 1px 1px 0 0 rgba(0, 0, 0, 0.3),
    inset 2px 2px 0 0 rgba(0, 0, 0, 0.22),
    inset 3px 3px 0 0 rgba(0, 0, 0, 0.14),
    inset -1px -1px 0 0 rgba(0, 0, 0, 0.3),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.22),
    inset -3px -3px 0 0 rgba(0, 0, 0, 0.14);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-accent);
  border-radius: 0 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.25),
    inset 1px 1px 0 0 rgba(0, 0, 0, 0.15),
    inset 2px 2px 0 0 rgba(0, 0, 0, 0.10),
    inset 3px 3px 0 0 rgba(0, 0, 0, 0.05),
    inset -1px -1px 0 0 rgba(0, 0, 0, 0.15),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.10),
    inset -3px -3px 0 0 rgba(0, 0, 0, 0.05);
}

body.light-mode .theme-toggle .icon-sun { display: block; }
body.light-mode .theme-toggle .icon-moon { display: none; }
body.light-mode .theme-toggle {
  border-color: #c79500;
  color: #eb7e00;
}
body.light-mode .theme-toggle:hover {
  border-color: #ff9400;
  box-shadow:
    0 0 9px color-mix(in srgb, #fd5d00 100%, transparent),
    inset 0 0 12px color-mix(in srgb, #f7de02 69%, transparent);
}
