/* The documentation site follows the Hivemind design system
   (@lesur-ai/hivemind-ui, the Portal's accepted Dashboard reference): its
   palette, its type ramp in Instrument Sans and its controls. The values below
   are the design system's own tokens, copied by name; the theme's variables
   are mapped onto them. The mark and the `hivemind` wordmark follow
   DESIGN/hivemind/BRAND_IDENTITY.md sections 5 and 6, as in the Portal. */
/* The same font files as the Portal serves, declared the same way. */
@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/InstrumentSans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/InstrumentSans-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --hm-color-oat-0: #ffffff;
  --hm-color-oat-200: #f5f2ef;
  --hm-color-oat-300: #eae8e5;
  --hm-color-oat-400: #dfdcd7;
  --hm-color-oat-600: #96938f;
  --hm-color-oat-700: #787571;
  --hm-color-oat-800: #63605c;
  --hm-color-oat-1000: #302d2a;
  --hm-color-oat-1100: #1f1d1a;
  --hm-color-espresso-100: #13110f;
  --hm-color-espresso-200: #1a1815;
  --hm-color-espresso-300: #22201d;
  --hm-color-espresso-600: #4f4c49;
  --hm-color-espresso-800: #95918e;
  --hm-color-espresso-900: #b4b0ad;
  --hm-color-espresso-1000: #d7d3d0;
  --hm-color-espresso-1100: #f3efeb;
  --hm-color-blueberry-400: #91c1ff;
  --hm-color-blueberry-500: #5da5fe;
  --hm-color-blueberry-600: #2086f6;
  --hm-color-blueberry-700: #0469cc;
  --hm-font-family-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hm-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hm-font-family-wordmark: "Newsreader", Georgia, "Times New Roman", serif;
  --hm-radius-medium: 6px;

  --md-text-font-family: var(--hm-font-family-sans);
  --md-code-font-family: var(--hm-font-family-mono);
}

[data-md-color-scheme="default"] {
  --hm-color-text-default: var(--hm-color-oat-1100);
  --hm-color-text-subtle: var(--hm-color-oat-800);
  --hm-color-text-inverse: var(--hm-color-oat-0);
  --hm-color-border-default: var(--hm-color-oat-400);
  --hm-color-border-bold: var(--hm-color-oat-600);
  --hm-color-border-focused: var(--hm-color-blueberry-600);
  --hm-color-link-default: var(--hm-color-blueberry-700);
  --hm-color-background-brand-bold-default: var(--hm-color-oat-1100);
  --hm-color-background-brand-bold-hovered: var(--hm-color-oat-1000);
  --hm-color-background-neutral-default: var(--hm-color-oat-200);
  --hm-color-background-neutral-hovered: var(--hm-color-oat-300);

  --md-default-bg-color: var(--hm-color-oat-0);
  --md-default-fg-color: var(--hm-color-text-default);
  --md-default-fg-color--light: var(--hm-color-text-subtle);
  --md-default-fg-color--lighter: var(--hm-color-oat-600);
  --md-default-fg-color--lightest: var(--hm-color-border-default);
  --md-primary-fg-color: var(--hm-color-oat-0);
  --md-primary-fg-color--light: var(--hm-color-oat-200);
  --md-primary-fg-color--dark: var(--hm-color-oat-300);
  --md-primary-bg-color: var(--hm-color-text-default);
  --md-primary-bg-color--light: var(--hm-color-text-subtle);
  --md-accent-fg-color: var(--hm-color-link-default);
  --md-accent-fg-color--transparent: rgba(4, 105, 204, 0.1);
  --md-typeset-a-color: var(--hm-color-link-default);
  --md-code-bg-color: var(--hm-color-oat-200);
  --md-code-fg-color: var(--hm-color-oat-1000);
  --md-footer-bg-color: var(--hm-color-oat-1100);
  --md-footer-bg-color--dark: var(--hm-color-espresso-100);
}

[data-md-color-scheme="slate"] {
  --hm-color-text-default: var(--hm-color-espresso-1000);
  --hm-color-text-subtle: var(--hm-color-espresso-900);
  --hm-color-text-inverse: var(--hm-color-espresso-100);
  --hm-color-border-default: var(--hm-color-espresso-600);
  --hm-color-border-bold: var(--hm-color-espresso-600);
  --hm-color-border-focused: var(--hm-color-blueberry-500);
  --hm-color-link-default: var(--hm-color-blueberry-400);
  --hm-color-background-brand-bold-default: var(--hm-color-espresso-1100);
  --hm-color-background-brand-bold-hovered: var(--hm-color-espresso-1000);
  --hm-color-background-neutral-default: var(--hm-color-espresso-300);
  --hm-color-background-neutral-hovered: var(--hm-color-espresso-600);

  --md-default-bg-color: var(--hm-color-espresso-100);
  --md-default-fg-color: var(--hm-color-text-default);
  --md-default-fg-color--light: var(--hm-color-text-subtle);
  --md-default-fg-color--lighter: var(--hm-color-espresso-800);
  --md-default-fg-color--lightest: var(--hm-color-border-default);
  --md-primary-fg-color: var(--hm-color-espresso-100);
  --md-primary-fg-color--light: var(--hm-color-espresso-200);
  --md-primary-fg-color--dark: var(--hm-color-espresso-100);
  --md-primary-bg-color: var(--hm-color-espresso-1100);
  --md-primary-bg-color--light: var(--hm-color-text-subtle);
  --md-accent-fg-color: var(--hm-color-link-default);
  --md-accent-fg-color--transparent: rgba(145, 193, 255, 0.14);
  --md-typeset-a-color: var(--hm-color-link-default);
  --md-code-bg-color: var(--hm-color-espresso-200);
  --md-code-fg-color: var(--hm-color-espresso-1000);
  --md-footer-bg-color: var(--hm-color-espresso-200);
  --md-footer-bg-color--dark: var(--hm-color-espresso-100);
}

/* Type ramp. The theme sets 1rem to 20px; the design system's sizes are given
   here in that unit: heading xlarge 30px, large 24px, medium 20px, all at
   weight 600 in the default text colour. */
body,
input {
  font-family: var(--hm-font-family-sans);
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: var(--hm-font-family-sans);
  font-weight: 600;
  line-height: 1.3;
  color: var(--hm-color-text-default);
}

.md-typeset h1 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.md-typeset h2 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.md-typeset h3 {
  font-size: 1rem;
  letter-spacing: -0.005em;
}

.md-typeset a:not(.md-button):not(.headerlink) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Header: the Portal's top bar is a light surface closed by a hairline, not a
   coloured band with a shadow. */
.md-header,
.md-tabs {
  box-shadow: none;
}

.md-header--shadow {
  box-shadow: none;
}

.md-header {
  border-bottom: 1px solid var(--hm-color-border-default);
}

[data-md-color-primary] .md-tabs {
  background-color: var(--md-primary-fg-color);
  border-bottom: 1px solid var(--hm-color-border-default);
}

[data-md-color-primary] .md-header {
  background-color: var(--md-primary-fg-color);
}

.md-search__form {
  border-radius: var(--hm-radius-medium);
}

.md-nav__item .md-nav__link--active,
.md-tabs__item--active .md-tabs__link {
  font-weight: 600;
  color: var(--hm-color-text-default);
}

/* Header lockup: the 32px reduction of the mark, then the lowercase
   `hivemind` wordmark in Newsreader 500. The theme hides the logo below
   76.25em and sets the site name in bold; the mark stays visible at every
   width, after the menu button when there is one. The dark surface takes the
   dark-surface variant of the mark. */
.md-header__button.md-logo {
  display: inline-block;
  padding: 0.2rem;
}

.md-header__button.md-logo :is(img, svg),
.md-nav__title .md-logo :is(img, svg) {
  width: 1.6rem;
  height: 1.6rem;
}

[data-md-color-scheme="slate"] .md-logo img {
  content: url("../assets/hivemind-mark-32-dark.svg");
}

.md-header__button[for="__drawer"] {
  order: -1;
}

[dir="ltr"] .md-header__button.md-logo + .md-header__button[for="__drawer"] + .md-header__title,
[dir="ltr"] .md-header__button.md-logo + .md-header__title {
  margin-left: 0.2rem;
}

.md-header__title .md-header__topic:first-child {
  font-family: var(--hm-font-family-wordmark);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: lowercase;
}

/* Buttons: the design system's default and primary Button, 40px high. */
.md-typeset .md-button {
  padding: 0 0.8rem;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: calc(2rem - 2px);
  color: var(--hm-color-text-default);
  background-color: var(--md-default-bg-color);
  border: 1px solid var(--hm-color-border-bold);
  border-radius: var(--hm-radius-medium);
}

.md-typeset .md-button:is(:hover, :focus) {
  color: var(--hm-color-text-default);
  background-color: var(--hm-color-background-neutral-hovered);
  border-color: var(--hm-color-border-bold);
}

.md-typeset .md-button--primary {
  color: var(--hm-color-text-inverse);
  background-color: var(--hm-color-background-brand-bold-default);
  border-color: var(--hm-color-background-brand-bold-default);
}

.md-typeset .md-button--primary:is(:hover, :focus) {
  color: var(--hm-color-text-inverse);
  background-color: var(--hm-color-background-brand-bold-hovered);
  border-color: var(--hm-color-background-brand-bold-hovered);
}

/* Visible keyboard focus on every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.md-nav__link:focus-visible,
.md-tabs__link:focus-visible {
  outline: 2px solid var(--hm-color-border-focused);
  outline-offset: 2px;
}

/* Home page hero: the page heading at the design system's largest size
   (heading xxlarge, 40px, weight 700), then one supporting line. */
.md-typeset .hm-hero {
  max-width: 36rem;
  margin: 1.2rem 0 2.4rem;
}

.md-typeset .hm-hero h1 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.md-typeset .hm-hero .md-button {
  margin: 0.4rem 0.4rem 0 0;
}

@media screen and (max-width: 44.984375em) {
  .md-typeset .hm-hero h1 {
    font-size: 1.5rem;
  }
}

/* Cards: the design system's bordered surface, with no shadow on hover. */
.md-typeset .grid.cards > :is(ul, ol) > li {
  padding: 1rem;
  border: 1px solid var(--hm-color-border-default);
  border-radius: 8px;
}

.md-typeset .grid.cards > :is(ul, ol) > li:is(:hover, :focus-within) {
  border-color: var(--hm-color-border-bold);
  box-shadow: none;
}

/* Memory horizon tags used in prose. */
.hm-horizon {
  font-family: var(--hm-font-family-mono);
  font-size: 0.8em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1em 0.45em;
  border-radius: 999px;
  border: 1px solid currentColor;
}

/* Top-level navigation from 60em instead of the theme's 76.25em: the nine
   sections fit on one line at that width. */
@media screen and (min-width: 60em) and (max-width: 76.234375em) {
  .md-tabs {
    display: block;
  }
}
