/* ── Custom palette overrides ───────────────────────────── */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #6366f1;
  --md-primary-fg-color--light: #818cf8;
  --md-primary-fg-color--dark:  #4f46e5;
  --md-accent-fg-color:         #c084fc;
  --md-default-bg-color:        #0f172a;
  --md-default-bg-color--light: #1e293b;
  --md-default-bg-color--lighter: #334155;
  --md-default-fg-color:        #e2e8f0;
  --md-default-fg-color--light: #94a3b8;
  --md-typeset-a-color:         #818cf8;
  --md-code-bg-color:           #1e293b;
  --md-code-hl-color:           rgba(99, 102, 241, 0.15);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #4f46e5;
  --md-primary-fg-color--light: #6366f1;
  --md-primary-fg-color--dark:  #3730a3;
  --md-accent-fg-color:         #7c3aed;
  --md-typeset-a-color:         #4f46e5;
}

/* ── Header ─────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-header {
  background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 1px 0 rgba(99,102,241,0.3);
}

[data-md-color-scheme="default"] .md-header {
  background: linear-gradient(90deg, #4338ca 0%, #6d28d9 100%);
}

/* ── Navigation tabs ────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-tabs {
  background: #16213e;
  border-bottom: 1px solid rgba(99,102,241,0.2);
}

[data-md-color-scheme="default"] .md-tabs {
  background: linear-gradient(90deg, #4338ca, #6d28d9);
}

/* ── Sidebar ────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-nav__title {
  color: #818cf8;
}

[data-md-color-scheme="slate"] .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav__link:is(:focus, :hover) {
  color: #a5b4fc;
}

/* ── Code blocks ────────────────────────────────────────── */
.md-typeset pre > code {
  border-radius: 0.5rem;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: #1e293b;
  color: #a5b4fc;
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

/* ── Tables ─────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) tr:hover > td {
  background: rgba(99, 102, 241, 0.05);
}

/* ── Admonitions ────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  border-color: rgba(99, 102, 241, 0.3);
}

/* ── Search ─────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-search__form {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
}

[data-md-color-scheme="slate"] .md-search__input::placeholder {
  color: #475569;
}

/* ── Footer ─────────────────────────────────────────────── */
[data-md-color-scheme="slate"] .md-footer {
  background: #0a0f1e;
}

/* ── Smooth scrollbar ───────────────────────────────────── */
:root {
  scroll-behavior: smooth;
}

/* ── Typography tweaks ──────────────────────────────────── */
.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
