/* krathos.systems brand overlay for the Zensical theme.
 *
 * Values mirror artifacts/krathos-systems/src/index.css in the website repo.
 * That file is the source of truth — if the brand changes there, change it
 * here. Kept as a thin overlay rather than a custom theme so theme upgrades
 * stay boring.
 *
 *   background   0 0% 4%      #0a0a0a
 *   foreground   0 0% 98%     #fafafa
 *   accent      38 92% 50%    #f59e0b
 *   border       0 0% 15%
 *   radius       0            sharp corners, deliberately (audience boxes excepted)
 *   muted accent rgba(245,158,11,.35) audience-box outline; full accent is too bright
 */

/* Webfonts, self-hosted so the served page makes zero external requests
 * (check-external-assets.sh enforces it). Variable-weight Latin subsets from
 * Fontsource, SIL OFL 1.1 — licences alongside in assets/fonts/. Anything
 * outside the Latin subset falls back to the system font. */
@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-wght-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 {
  /* Set through the theme's variables, not font-family, so its system-font
   * fallback stack stays in place behind them. */
  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";

  --krathos-accent: #f59e0b;
  --krathos-accent-dim: #d97706;
  --md-accent-fg-color: var(--krathos-accent);
  --md-accent-fg-color--transparent: rgba(245, 158, 11, 0.1);
}

/* Dark — the primary presentation, matching the website's default. */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: hsl(0 0% 4%);
  --md-default-bg-color--light: hsl(0 0% 6%);
  --md-default-fg-color: hsl(0 0% 98%);
  --md-default-fg-color--light: hsl(0 0% 60%);
  --md-default-fg-color--lighter: hsl(0 0% 40%);
  --md-typeset-color: hsl(0 0% 88%);
  --md-typeset-a-color: var(--krathos-accent);
  --md-code-bg-color: hsl(0 0% 8%);
  --md-code-fg-color: hsl(0 0% 92%);
  --md-footer-bg-color: hsl(0 0% 6%);
  --md-footer-bg-color--dark: hsl(0 0% 4%);
}

[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-tabs {
  background-color: hsl(0 0% 6%);
  border-bottom: 1px solid hsl(0 0% 15%);
}

/* Light — kept usable for anyone who prefers it, but the brand stays. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: var(--krathos-accent-dim);
}

[data-md-color-scheme="default"] .md-header {
  background-color: hsl(0 0% 4%);
  color: hsl(0 0% 98%);
}

/* Krathos uses sharp corners throughout; the theme rounds these by default. */
.md-typeset pre > code,
.md-typeset .admonition,
.md-typeset details,
.md-typeset table:not([class]),
.md-search__button,
.md-typeset .tabbed-set > .tabbed-labels,
.md-button {
  border-radius: 0 !important;
}

/* Display face for headings, matching the website's Syne usage.
 * Falls back cleanly: Syne is not vendored, so this only applies where the
 * visitor already has it (having come from krathos.systems). Body text uses
 * Inter, which is self-hosted above. */
.md-typeset h1,
.md-typeset h2,
.md-header__title {
  font-family: "Syne", var(--md-text-font-family), sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Accent the active nav item rather than tinting the whole label, which reads
 * closer to the website's minimal navigation. */
.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  color: var(--krathos-accent);
  font-weight: 500;
}

.md-typeset a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Admonitions: square, accent-led, no pastel fills. */
.md-typeset .admonition,
.md-typeset details {
  border-width: 1px;
  border-left-width: 3px;
  box-shadow: none;
}

/* Audience boxes (`??? audience "Title"`): a muted orange outline, no fill, and
 * the one place corners are rounded — they are cards to pick from, not
 * callouts. Keep the accent translucent; full strength read as too bright. */
.md-typeset details.audience {
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 0.4rem !important;
  background: none;
}

.md-typeset details.audience > summary {
  background: none;
  font-weight: 600;
}

.md-typeset details.audience > summary::before,
.md-typeset details.audience > summary::after {
  background-color: rgba(245, 158, 11, 0.6);
}
