/* Visual language shared with the API reference (generator), Mikoshi and the
   replay.re splash page: same tokens, same two fonts, same motifs. Material
   sizes in rem off a 20px root, so this file sticks to px. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg-0: #06080e;
  --bg-1: #0a0e16;
  --bg-2: #10151f;
  --bg-3: #181e2c;
  --line: #1e2533;
  --line-strong: #2b3447;
  --fg: #eceff6;
  --fg-muted: #8f98ae;
  --fg-subtle: #5a6378;
  --fg-on-accent: #04121a;
  --accent: #22d3ee;
  --accent-strong: #67e8f9;
  --accent-deep: #0e7490;
  --accent-a10: rgba(34, 211, 238, 0.1);
  --accent-a30: rgba(34, 211, 238, 0.3);
  --success: #34d399;
  --warning: #f5b544;
  --danger: #f26d7c;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --chamfer: 9px;

  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";
}

/* Map Material's slate scheme onto the shared tokens. */
[data-md-color-scheme="slate"] {
  --md-hue: 222;

  --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: var(--line);

  --md-default-bg-color: var(--bg-0);
  --md-default-bg-color--light: var(--bg-1);
  --md-default-bg-color--lighter: var(--bg-2);
  --md-default-bg-color--lightest: var(--bg-3);

  --md-primary-fg-color: var(--bg-0);
  --md-primary-fg-color--light: var(--bg-1);
  --md-primary-fg-color--dark: var(--bg-0);
  --md-primary-bg-color: var(--fg);
  --md-primary-bg-color--light: var(--fg-muted);

  --md-accent-fg-color: var(--accent-strong);
  --md-accent-fg-color--transparent: var(--accent-a10);
  --md-accent-bg-color: var(--bg-3);
  --md-accent-bg-color--light: var(--accent-a10);

  --md-typeset-color: var(--fg);
  --md-typeset-a-color: var(--accent);
  --md-typeset-mark-color: var(--accent-a30);

  --md-typeset-table-color: var(--line);
  --md-typeset-table-color--light: var(--bg-1);

  --md-admonition-bg-color: var(--bg-1);
  --md-admonition-fg-color: var(--fg);

  --md-code-bg-color: var(--bg-0);
  --md-code-fg-color: var(--fg-muted);
  --md-code-hl-color: var(--accent-a10);
  --md-code-hl-color--light: rgba(34, 211, 238, 0.06);
  --md-code-hl-keyword-color: var(--accent);
  --md-code-hl-name-color: var(--fg-muted);
  --md-code-hl-function-color: var(--fg);
  --md-code-hl-variable-color: var(--fg-muted);
  --md-code-hl-constant-color: var(--accent-strong);
  --md-code-hl-special-color: var(--accent-strong);
  --md-code-hl-number-color: var(--danger);
  --md-code-hl-operator-color: var(--fg-muted);
  --md-code-hl-punctuation-color: var(--fg-subtle);
  --md-code-hl-string-color: var(--success);
  --md-code-hl-comment-color: var(--fg-subtle);
  --md-code-hl-generic-color: var(--fg-muted);

  --md-footer-fg-color: var(--fg-muted);
  --md-footer-fg-color--light: var(--fg-muted);
  --md-footer-fg-color--lighter: var(--fg-subtle);
  --md-footer-bg-color: var(--bg-0);
  --md-footer-bg-color--dark: var(--bg-0);

  --md-shadow-z1: none;
  --md-shadow-z2: none;
  --md-shadow-z3: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
}
/* Palette CSS sets the link color under this selector with higher specificity. */
[data-md-color-scheme="slate"][data-md-color-primary="indigo"] {
  --md-typeset-a-color: var(--accent);
}

/* ---- Base ------------------------------------------------------------------ */
html {
  overflow-x: clip;
  background: var(--bg-0);
}
body {
  background: var(--bg-0);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
}
/* Scanlines over everything, barely there. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}
::selection {
  background: var(--accent);
  color: var(--fg-on-accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ---- Typography ------------------------------------------------------------ */
.md-typeset {
  font-size: 16px;
  line-height: 1.6;
}
.md-typeset a {
  transition: color 150ms var(--ease);
}
.md-typeset a:hover {
  color: var(--accent-strong);
}
.md-typeset strong {
  color: var(--fg);
  font-weight: 600;
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  color: var(--fg);
}
.md-typeset h1 {
  font-weight: 700;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 12px 0 24px;
}
.md-typeset h2 {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 48px 0 12px;
}
.md-typeset h3 {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin: 32px 0 8px;
}
/* h4+ read as the mono eyebrow used across the sibling sites. */
.md-typeset :is(h4, h5, h6) {
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 24px 0 8px;
}
.md-typeset .headerlink {
  color: var(--fg-subtle);
}
.md-typeset .headerlink:is(:hover, :focus) {
  color: var(--accent);
}
.md-typeset hr {
  border-bottom-color: var(--line);
}

/* Eyebrow: mono label behind a short cyan rule. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.md-typeset .dim {
  color: var(--fg-muted);
  font-weight: 300;
}

/* ---- Header: full-bleed 64px bar, like the API reference topbar ------------ */
.md-header {
  background: rgba(6, 8, 14, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.md-header--shadow {
  box-shadow: none;
}
.md-header__inner {
  max-width: none;
  height: 64px;
  padding: 0 clamp(8px, 4vw, 32px);
}
/* Sidebars stick below the taller bar (Material measures the rest in JS). */
.md-sidebar {
  top: 64px;
}
.md-header__title {
  height: 64px;
  line-height: 64px;
  margin-left: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.md-header__title .md-header__topic {
  transition-duration: 250ms;
}
.md-header__button.md-logo {
  align-items: center;
  margin: 0;
  padding: 0;
}
.mark {
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 2px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 320ms var(--ease);
}
.md-logo:hover .mark {
  transform: rotate(135deg);
}
.md-header .md-icon:hover {
  color: var(--fg);
  opacity: 1;
}

/* Search */
.md-search__form {
  height: 38px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
.md-search__form:hover {
  background: var(--bg-1);
  border-color: var(--line-strong);
}
@media screen and (min-width: 60em) {
  .md-search__inner {
    width: 400px;
  }
  /* "/" focuses search in Material too; show the same hint as the reference. */
  .md-search__form::after {
    content: "/";
    position: absolute;
    top: 8px;
    right: 9px;
    min-width: 20px;
    padding: 0 6px;
    font: 500 12px/18px var(--mono);
    text-align: center;
    color: var(--fg-muted);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: var(--r-sm);
    pointer-events: none;
  }
  [data-md-toggle="search"]:checked ~ .md-header .md-search__form::after {
    opacity: 0;
  }
}
[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  background: var(--bg-0);
  border-color: var(--accent);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.md-search__input {
  font-size: 14px;
  color: var(--fg);
  caret-color: var(--accent);
}
.md-search__input::placeholder,
.md-search__icon {
  color: var(--fg-muted);
}
.md-search__overlay {
  background: rgba(6, 8, 14, 0.7);
}
.md-search__output {
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.md-search__scrollwrap,
.md-search-result__meta {
  background: var(--bg-1);
}
.md-search-result__meta {
  font: 500 12px var(--mono);
  color: var(--fg-muted);
  border-bottom: 1px solid var(--line);
}
.md-search-result__item {
  box-shadow: 0 -1px var(--line);
}
.md-search-result__link:is(:hover, :focus, [data-md-state="active"]) {
  background: var(--bg-3);
  box-shadow: inset 2px 0 0 var(--accent);
}
.md-search-result mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 600;
}

/* ---- Navigation ------------------------------------------------------------ */
.md-nav__link {
  transition: color 150ms var(--ease);
}
.md-sidebar--primary .md-nav__link {
  color: var(--fg-muted);
}
.md-sidebar--primary .md-nav__link:is(:hover, :focus) {
  color: var(--fg);
}
/* Current page: white label on a 2px cyan rail. */
.md-sidebar--primary .md-nav__link--active:not(.md-nav__container),
.md-sidebar--primary .md-nav__container.md-nav__link--active > a {
  color: var(--fg);
}
@media screen and (min-width: 1220px) {
  .md-sidebar--primary .md-nav__link {
    margin-top: 0;
    padding: 5px 0 5px 12px;
    border-left: 2px solid transparent;
  }
  .md-sidebar--primary .md-nav__item .md-nav__item .md-nav__link {
    margin-left: -1px;
  }
  .md-sidebar--primary .md-nav__link--active:not(.md-nav__container) {
    border-left-color: var(--accent);
  }
  .md-sidebar--primary .md-nav__container,
  .md-sidebar--primary .md-nav__container > a {
    padding: 0;
    border: 0;
  }
  /* Page lists hang off a hairline, like the API reference TOC. */
  .md-sidebar--primary .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list {
    border-left: 1px solid var(--line);
  }
  .md-sidebar--primary .md-nav--primary .md-nav__item--section .md-nav .md-nav .md-nav__list {
    margin-left: 12px;
    border-left: 1px solid var(--line);
  }
  /* Brand row is redundant next to the header. */
  .md-sidebar--primary .md-nav--primary > .md-nav__title {
    display: none;
  }
}
/* Section labels: mono eyebrow. */
.md-sidebar--primary .md-nav__item--section > .md-nav__link,
.md-sidebar--primary .md-nav__item--section > .md-nav__link > a {
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.md-sidebar--primary .md-nav__item--section > .md-nav__link {
  margin: 24px 0 8px;
  padding-left: 0;
  border-left: 0;
}
.md-sidebar--primary .md-nav__item--section > .md-nav__link:is(:hover, :focus),
.md-sidebar--primary .md-nav__item--section > .md-nav__link > a:hover {
  color: var(--fg);
}
.md-sidebar--primary .md-nav__item--section > .md-nav__link--active,
.md-sidebar--primary .md-nav__item--section > .md-nav__link--active > a {
  color: var(--accent);
}

/* Right-hand TOC. */
.md-sidebar--secondary .md-nav__title {
  background: var(--bg-0);
  box-shadow: none;
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-left: 0;
}
.md-sidebar--secondary .md-nav--secondary > .md-nav__list {
  border-left: 1px solid var(--line);
}
.md-sidebar--secondary .md-nav__link {
  margin: 0 0 0 -1px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
}
.md-sidebar--secondary .md-nav .md-nav .md-nav__link {
  padding-left: 26px;
}
.md-sidebar--secondary .md-nav__link:hover {
  color: var(--fg);
  border-left-color: var(--line-strong);
}
.md-sidebar--secondary .md-nav__link--active {
  color: var(--fg);
  border-left-color: var(--accent);
}
/* Size the TOC to its content so it never shows a stray scrollbar. */
.md-sidebar--secondary .md-sidebar__scrollwrap {
  height: auto !important;
  max-height: calc(100vh - 8rem);
}
.md-sidebar--secondary .md-nav {
  margin-bottom: 0;
}

/* ---- Inline code, kbd, mark ------------------------------------------------ */
.md-typeset code {
  font-size: 0.86em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  color: var(--fg);
  word-break: normal;
  overflow-wrap: anywhere;
}
.md-typeset kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  font: 500 12px/20px var(--mono);
  text-align: center;
  color: var(--fg-muted);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  box-shadow: none;
}
.md-typeset mark {
  background: var(--accent-a30);
  color: var(--fg);
}

/* ---- Code blocks: HUD panel with corner brackets --------------------------- */
.md-typeset .highlight {
  position: relative;
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
}
.md-typeset .highlight::before,
.md-typeset .highlight::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 0 solid var(--accent);
  pointer-events: none;
}
.md-typeset .highlight::before {
  top: -1px;
  left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
}
.md-typeset .highlight::after {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}
.md-typeset pre {
  margin: 0;
}
.md-typeset pre > code {
  padding: 16px 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-muted);
  overflow-wrap: normal;
}
.md-typeset .highlight .c,
.md-typeset .highlight [class^="c"] {
  font-style: italic;
}
.md-typeset .highlight .filename {
  margin: 0;
  padding: 8px 18px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  font: 500 12px/1.6 var(--mono);
  color: var(--fg-muted);
}
.md-typeset .highlight .filename::before {
  display: none;
}
.md-typeset .md-code__button {
  color: var(--fg-subtle);
}
.md-typeset .md-code__button:hover {
  color: var(--accent);
}

/* ---- Tables: borderless, hairline rows ------------------------------------- */
.md-typeset table:not([class]) {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
}
.md-typeset table:not([class]) th {
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 8px 16px 12px;
  white-space: nowrap;
}
.md-typeset table:not([class]) td {
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  vertical-align: top;
}
.md-typeset table:not([class]) tbody tr {
  transition: background-color 150ms var(--ease);
}
.md-typeset table:not([class]) tbody tr:hover {
  background: var(--bg-1);
  box-shadow: none;
}
.md-typeset table:not([class]) code {
  font-size: 13px;
  background: none;
  border: 0;
  padding: 0;
  white-space: nowrap;
}

/* ---- Admonitions: semantic left rail on a quiet panel ---------------------- */
/* [class] lifts these over Material's per-type colours (.md-typeset .admonition.note). */
.md-typeset :is(.admonition, details)[class] {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: none;
  font-size: 15px;
}
.md-typeset :is(.admonition-title, summary) {
  background: transparent !important;
  border: 0;
  font-weight: 600;
  color: var(--fg);
}
.md-typeset :is(.admonition-title, summary)::before {
  background-color: var(--accent) !important;
}
.md-typeset :is(.tip, .hint, .important, .success, .check, .done):is(.admonition, details) {
  border-left-color: var(--success);
}
.md-typeset :is(.tip, .hint, .important, .success, .check, .done) > :is(.admonition-title, summary)::before {
  background-color: var(--success) !important;
}
.md-typeset :is(.question, .help, .faq, .warning, .caution, .attention):is(.admonition, details) {
  border-left-color: var(--warning);
}
.md-typeset :is(.question, .help, .faq, .warning, .caution, .attention) > :is(.admonition-title, summary)::before {
  background-color: var(--warning) !important;
}
.md-typeset :is(.failure, .fail, .missing, .danger, .error, .bug):is(.admonition, details) {
  border-left-color: var(--danger);
}
.md-typeset :is(.failure, .fail, .missing, .danger, .error, .bug) > :is(.admonition-title, summary)::before {
  background-color: var(--danger) !important;
}
.md-typeset :is(.example, .quote, .cite, .abstract, .summary, .tldr):is(.admonition, details) {
  border-left-color: var(--line-strong);
}
.md-typeset :is(.example, .quote, .cite, .abstract, .summary, .tldr) > :is(.admonition-title, summary)::before {
  background-color: var(--fg-muted) !important;
}

/* ---- Tabs ------------------------------------------------------------------ */
.md-typeset .tabbed-labels {
  box-shadow: 0 -1px var(--line) inset;
}
.md-typeset .tabbed-labels > label {
  font: 500 13px var(--mono);
  color: var(--fg-muted);
}
.md-typeset .tabbed-labels > label:hover {
  color: var(--fg);
}
.md-typeset .tabbed-set > input:checked + label,
.md-typeset .tabbed-alternate > input:checked ~ .tabbed-labels > label:is(:hover),
.md-typeset .tabbed-labels > label.tabbed-label--active {
  color: var(--fg);
}
.md-typeset .tabbed-labels::before {
  background: var(--accent);
}

/* ---- Buttons --------------------------------------------------------------- */
.md-typeset .md-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  background: rgba(16, 21, 31, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  transition: background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 200ms var(--ease);
}
.md-typeset .md-button:is(:hover, :focus) {
  color: var(--fg);
  background: var(--bg-3);
  border-color: #3a4560;
}
/* Primary: chamfered cyan block. */
.md-typeset .md-button--primary {
  color: var(--fg-on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 0;
  font-weight: 600;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.md-typeset .md-button--primary:is(:hover, :focus) {
  color: var(--fg-on-accent);
  background: var(--accent-strong);
  box-shadow: 0 0 40px var(--accent-a30);
}

/* ---- Footer ---------------------------------------------------------------- */
.md-footer {
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.md-footer__link {
  transition: color 150ms var(--ease);
}
.md-footer__link:hover {
  color: var(--accent);
  opacity: 1;
}
.md-footer__direction {
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.md-footer-meta {
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.md-copyright,
.md-copyright__highlight {
  color: var(--fg-subtle);
}

.md-top {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: none;
  color: var(--fg-muted);
  font: 500 12px var(--mono);
}
.md-top:hover {
  background: var(--bg-3);
  color: var(--fg);
}

/* ---- Landing page ---------------------------------------------------------- */
/* Hero pages: full-bleed masked grid with an off-centre cyan bloom, starting
   under the translucent header. Hung off .md-main so it spans the viewport
   and sits beneath the sidebars instead of over them. */
.md-main:has(.hero) {
  position: relative;
  isolation: isolate; /* keep the backdrop above the body background */
}
.md-main:has(.hero)::before,
.md-main:has(.hero)::after {
  content: "";
  position: absolute;
  top: -64px;
  left: 0;
  right: 0;
  height: 620px;
  z-index: -1;
  pointer-events: none;
}
.md-main:has(.hero)::before {
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 30%, #000 20%, transparent 75%);
  opacity: 0.6;
}
.md-main:has(.hero)::after {
  background: radial-gradient(ellipse 40% 50% at 70% 30%, rgba(34, 211, 238, 0.12), transparent 70%);
}
.hero {
  padding: 48px 0 8px;
}
.md-typeset .hero h1 {
  margin: 24px 0 0;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.md-typeset .hero h1 .dim {
  display: block;
}
.md-typeset .lede {
  margin: 24px 0 0;
  max-width: 38em;
  font-size: 17px;
  color: var(--fg-muted);
}

/* Browse tiles: hairline-divided grid with a sliding arrow. */
.md-typeset .browse {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin: 40px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* Hairlines drawn per tile, so a half-empty last row doesn't fill in grey. */
.md-typeset .browse a {
  box-shadow: 0 0 0 1px var(--line);
}
.md-typeset .browse a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 24px;
  background: var(--bg-0);
  color: var(--fg);
  transition: background-color 200ms var(--ease);
}
.md-typeset .browse a::after {
  content: "\2192";
  position: absolute;
  top: 24px;
  right: 24px;
  color: var(--fg-muted);
  transition: transform 150ms var(--ease), color 150ms var(--ease);
}
.md-typeset .browse a:hover {
  background: var(--bg-1);
  color: var(--fg);
}
.md-typeset .browse a:hover::after {
  color: var(--accent);
  transform: translateX(3px);
}
.tile-label {
  padding-right: 24px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.tile-stat {
  font: 500 12px/1.5 var(--mono);
  color: var(--fg-muted);
}

/* ---- Mobile drawer --------------------------------------------------------- */
@media screen and (max-width: 1219.98px) {
  .md-sidebar--primary,
  .md-nav--primary .md-nav__title,
  .md-nav--primary .md-nav__title[for="__drawer"] {
    background: var(--bg-1);
  }
  .md-nav--primary .md-nav__title {
    border-bottom: 1px solid var(--line);
    color: var(--fg);
    font-weight: 600;
  }
  .md-nav--primary .md-nav__title .md-logo .mark {
    margin: 8px 4px;
  }
  .md-nav--primary .md-nav__item {
    border-top: 0;
  }
  .md-sidebar--primary .md-nav__link--active:not(.md-nav__container) {
    color: var(--fg);
    box-shadow: inset 2px 0 0 var(--accent);
  }
}

/* ---- Motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  body::after {
    display: none;
  }
}
