/* ═══════════════════════════════════════════════════════
   Mavery Docs — full design-system match
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── tokens ─────────────────────────────────────────── */
:root {
  --bg:          hsl(240 10% 4%);
  --bg-card:     rgba(10,10,14,0.62);
  --bg-glass:    rgba(10,10,14,0.72);
  --border:      rgba(255,255,255,0.08);
  --border-mid:  rgba(255,255,255,0.12);
  --teal:        #2dd4bf;
  --sky:         #38bdf8;
  --green:       #22c55e;
  --fg:          rgba(255,255,255,0.92);
  --fg-muted:    rgba(255,255,255,0.55);
  --fg-subtle:   rgba(255,255,255,0.30);
  --blur:        blur(16px);
  --radius-card: 16px;
  --nav-h:       64px;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color:           var(--bg);
  --md-default-bg-color--light:    hsl(240 10% 6%);
  --md-default-bg-color--lighter:  hsl(240 10% 8%);
  --md-default-bg-color--lightest: hsl(240 10% 12%);
  --md-default-fg-color:           var(--fg);
  --md-default-fg-color--light:    var(--fg-muted);
  --md-default-fg-color--lighter:  var(--fg-subtle);
  --md-default-fg-color--lightest: rgba(255,255,255,0.15);
  --md-primary-fg-color:           var(--teal);
  --md-primary-fg-color--light:    var(--sky);
  --md-primary-fg-color--dark:     #14b8a6;
  --md-primary-bg-color:           var(--bg);
  --md-accent-fg-color:            var(--sky);
  --md-accent-fg-color--transparent: rgba(56,189,248,0.12);
  --md-code-bg-color:              rgba(10,10,14,0.85);
  --md-code-fg-color:              rgba(255,255,255,0.82);
}

/* ── reset / base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--bg) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif !important;
  letter-spacing: -0.02em;
}

/* ── ambient aurora blobs ────────────────────────────── */
body::before, body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 9999px;
  filter: blur(90px);
}
body::before {
  top: -8vh; left: -5vw;
  width: 55vw; height: 50vh;
  background: radial-gradient(circle at 40% 40%,
    rgba(45,212,191,0.09), rgba(56,189,248,0.06) 45%, transparent 70%);
  animation: blob-a 24s ease-in-out infinite;
}
body::after {
  bottom: -5vh; right: -8vw;
  width: 60vw; height: 50vh;
  background: radial-gradient(circle at 60% 55%,
    rgba(34,197,94,0.07), rgba(56,189,248,0.06) 40%, transparent 70%);
  animation: blob-b 30s ease-in-out infinite;
}
@keyframes blob-a {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(4vw,-3vh) scale(1.08); }
}
@keyframes blob-b {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-3vw,4vh) scale(1.06); }
}

/* ════════════════════════════════════════════════════════
   MAVERY NAV
   ════════════════════════════════════════════════════════ */
.mvr-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,16,0.82);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.mvr-nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mvr-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.mvr-nav__logo {
  height: 32px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.mvr-nav__logo-fallback {
  display: none;
  width: 32px; height: 32px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--teal), var(--sky));
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #000;
}
.mvr-nav__beta {
  border: 1px solid rgba(251,191,36,0.25);
  background: rgba(251,191,36,0.12);
  color: rgba(253,230,138,0.9);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mvr-nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.mvr-nav__links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 160ms ease;
  white-space: nowrap;
}
.mvr-nav__links a:hover,
.mvr-nav__link--active {
  color: var(--fg) !important;
}
.mvr-nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.mvr-nav__login {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 160ms ease;
  white-space: nowrap;
}
.mvr-nav__login:hover { color: var(--fg); }
.mvr-nav__download {
  background: #fff;
  color: #000 !important;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(255,255,255,0.25);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.mvr-nav__download:hover {
  transform: scale(1.03);
  box-shadow: 0 0 22px rgba(255,255,255,0.35);
}
/* hamburger */
.mvr-nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.mvr-nav__burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--fg-muted);
  border-radius: 2px;
  transition: background 160ms;
}
.mvr-nav__burger:hover span { background: var(--fg); }
/* mobile dropdown */
.mvr-nav__mobile {
  display: none;
  flex-direction: column;
  padding: 0.75rem 1.5rem 1.25rem;
  gap: 0.25rem;
  border-top: 1px solid var(--border);
  background: rgba(9,9,16,0.96);
}
.mvr-nav__mobile a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 160ms;
}
.mvr-nav__mobile a:hover { color: var(--teal); }
.mvr-nav__mobile--open { display: flex; }

@media (max-width: 900px) {
  .mvr-nav__links { display: none; }
  .mvr-nav__login { display: none; }
  .mvr-nav__burger { display: flex; }
}
@media (max-width: 480px) {
  .mvr-nav__download { display: none; }
}

/* hide the default Material header visually but keep it for JS */
.mvr-md-header-hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* push content below our fixed nav */
.md-container {
  padding-top: var(--nav-h) !important;
}
.md-header {
  display: none !important;
}

/* ════════════════════════════════════════════════════════
   MAVERY FOOTER
   ════════════════════════════════════════════════════════ */
/* hide default Material footer */
.md-footer { display: none !important; }

.mvr-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
  background: rgba(9,9,16,0.88);
  position: relative;
  z-index: 1;
}
.mvr-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .mvr-footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}
.mvr-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mvr-footer__logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}
.mvr-footer__name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--fg);
  font-size: 0.9375rem;
}
.mvr-footer__copy {
  font-size: 0.8125rem;
  color: var(--fg-subtle);
}
.mvr-footer__links {
  display: flex;
  gap: 1.5rem;
}
.mvr-footer__links a {
  font-size: 0.8125rem;
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color 160ms ease;
}
.mvr-footer__links a:hover { color: var(--fg); }

/* ════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════ */
.md-sidebar {
  background: transparent !important;
  top: var(--nav-h) !important;
}
.md-sidebar__scrollwrap {
  background: transparent !important;
  padding: 1.25rem 0.75rem !important;
}

/* section titles */
.md-nav__title {
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  color: var(--fg-subtle) !important;
  padding: 0.75rem 0.75rem 0.35rem !important;
  margin-top: 0.25rem;
}

/* nav items */
.md-nav__item { padding: 1px 0; }

.md-nav__link {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.8375rem !important;
  font-weight: 500 !important;
  color: var(--fg-muted) !important;
  border-radius: 8px !important;
  padding: 0.45rem 0.75rem !important;
  margin: 0 !important;
  transition: background 160ms ease, color 160ms ease !important;
  display: block;
  text-decoration: none !important;
}
.md-nav__link:hover {
  background: rgba(255,255,255,0.05) !important;
  color: var(--fg) !important;
}

/* active pill */
.md-nav__link--active {
  background: rgba(45,212,191,0.10) !important;
  color: var(--teal) !important;
  font-weight: 600 !important;
  position: relative;
}
.md-nav__link--active::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(45,212,191,0.45);
}

/* separator between sections */
.md-nav__item--section > .md-nav__link {
  margin-top: 0.5rem !important;
}

/* ════════════════════════════════════════════════════════
   MAIN / CONTENT LAYOUT
   ════════════════════════════════════════════════════════ */
.md-main {
  background: transparent !important;
  position: relative;
  z-index: 1;
}
.md-main__inner {
  background: transparent !important;
}
.md-content {
  position: relative;
  z-index: 1;
}

/* the main content card */
.md-content__inner {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  padding: 2.25rem 2.75rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 2rem !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 24px 48px rgba(0,0,0,0.38) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

/* ════════════════════════════════════════════════════════
   TYPOGRAPHY
   ════════════════════════════════════════════════════════ */
.md-typeset {
  color: var(--fg-muted) !important;
  font-size: 0.9375rem !important;
  line-height: 1.8 !important;
}

/* H1 — aurora gradient */
.md-typeset h1 {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 700 !important;
  font-size: 2rem !important;
  background: linear-gradient(135deg, var(--teal) 0%, var(--sky) 55%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0.6em;
  margin-bottom: 1.5rem !important;
}

/* H2 — release date style */
.md-typeset h2 {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 600 !important;
  font-size: 1.175rem !important;
  color: var(--fg) !important;
  -webkit-text-fill-color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0;
  border: none !important;
}
/* date pill on h2 */
.md-typeset h2::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 9999px;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(45,212,191,0.55);
  flex-shrink: 0;
}

.md-typeset h3 {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  color: rgba(255,255,255,0.70) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.70);
  margin-top: 1.5rem !important;
}

/* ── paragraphs & lists ─────────────────────────────── */
.md-typeset p {
  color: var(--fg-muted) !important;
}

.md-typeset ul {
  padding-left: 0 !important;
  list-style: none !important;
}

/* changelog entry cards */
.md-typeset h2 + ul,
.md-typeset h3 + ul {
  background: rgba(255,255,255,0.025) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid rgba(45,212,191,0.35) !important;
  border-radius: 10px !important;
  padding: 0.875rem 1.25rem !important;
  margin: 0.25rem 0 1.5rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.md-typeset h2 + ul li,
.md-typeset h3 + ul li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.3rem 0;
  color: var(--fg-muted) !important;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.md-typeset h2 + ul li:last-child,
.md-typeset h3 + ul li:last-child {
  border-bottom: none;
}
.md-typeset h2 + ul li::before,
.md-typeset h3 + ul li::before {
  content: "▸";
  color: var(--teal);
  font-size: 0.65em;
  flex-shrink: 0;
  margin-top: 0.1em;
}

/* regular lists */
.md-typeset ul li {
  padding: 0.2rem 0;
  color: var(--fg-muted) !important;
}
.md-typeset ul li::marker { color: var(--teal); }

/* ── links ──────────────────────────────────────────── */
.md-typeset a {
  color: var(--teal) !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(45,212,191,0.22);
  transition: color 160ms ease, border-color 160ms ease;
}
.md-typeset a:hover {
  color: var(--sky) !important;
  border-bottom-color: rgba(56,189,248,0.45);
}

/* ── code ───────────────────────────────────────────── */
.md-typeset code {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.835em !important;
  background: rgba(10,10,14,0.85) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--sky) !important;
  border-radius: 5px !important;
  padding: 0.15em 0.45em !important;
}
.md-typeset pre {
  background: rgba(10,10,14,0.9) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.32) !important;
  padding: 1.25rem 1.5rem !important;
}
.md-typeset pre code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: rgba(255,255,255,0.82) !important;
  font-size: 0.875rem !important;
}
/* copy button */
.md-clipboard {
  color: var(--fg-subtle) !important;
}
.md-clipboard:hover {
  color: var(--teal) !important;
}

/* ── search ─────────────────────────────────────────── */
.md-search__form {
  background: rgba(255,255,255,0.055) !important;
  border: 1px solid var(--border-mid) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(12px) !important;
}
.md-search__input {
  color: var(--fg) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.875rem !important;
}
.md-search__input::placeholder { color: var(--fg-subtle) !important; }
.md-search__icon { color: var(--fg-subtle) !important; }
.md-search-result {
  background: rgba(9,9,16,0.96) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(16px) !important;
}
.md-search-result__item { border-top: 1px solid rgba(255,255,255,0.04) !important; }
.md-search-result__link:hover { background: rgba(45,212,191,0.06) !important; }
.md-search-result__title {
  color: var(--fg) !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 600 !important;
}
.md-search-result__teaser { color: var(--fg-muted) !important; }
.md-search-result mark {
  background: rgba(45,212,191,0.18) !important;
  color: var(--teal) !important;
  border-radius: 3px;
  padding: 0 2px;
}

/* ── tables ─────────────────────────────────────────── */
.md-typeset table:not([class]) {
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  overflow: hidden;
  border-spacing: 0;
}
.md-typeset table:not([class]) th {
  background: rgba(45,212,191,0.07) !important;
  color: var(--fg) !important;
  border-bottom: 1px solid var(--border-mid) !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  padding: 0.75rem 1rem !important;
}
.md-typeset table:not([class]) td {
  border-color: rgba(255,255,255,0.04) !important;
  color: var(--fg-muted) !important;
  padding: 0.625rem 1rem !important;
  font-size: 0.875rem !important;
}
.md-typeset table:not([class]) tr:nth-child(even) td {
  background: rgba(255,255,255,0.02) !important;
}
.md-typeset table:not([class]) tr:hover td {
  background: rgba(45,212,191,0.04) !important;
}

/* ── admonitions ────────────────────────────────────── */
.md-typeset .admonition,
.md-typeset details {
  background: rgba(10,10,14,0.72) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--teal) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25) !important;
}
.md-typeset .admonition-title,
.md-typeset summary {
  background: rgba(45,212,191,0.07) !important;
  color: var(--fg) !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 600 !important;
  border-radius: 8px 8px 0 0 !important;
}

/* ── scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(45,212,191,0.20);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(45,212,191,0.38);
}
