/*
 * DefendFlow documentation theme
 *
 * Mirrors defendflow.xyz: Geist typography, midnight surfaces, cyan signal
 * color, technical grid, translucent rules, and square security-tool panels.
 */

:root {
  --df-midnight: #070b12;
  --df-surface: #090f19;
  --df-elevated: #0f172a;
  --df-cyan: #67e8f9;
  --df-cyan-strong: #22d3ee;
  --df-text: #f8fafc;
  --df-text-secondary: #cbd5e1;
  --df-text-muted: #94a3b8;
  --df-rule: rgba(255, 255, 255, 0.1);
  --df-rule-cyan: rgba(103, 232, 249, 0.25);

  --md-primary-fg-color: var(--df-midnight);
  --md-primary-fg-color--light: var(--df-surface);
  --md-primary-fg-color--dark: #020617;
  --md-accent-fg-color: var(--df-cyan);
  --md-accent-fg-color--transparent: rgba(103, 232, 249, 0.1);

  --md-default-bg-color: var(--df-surface);
  --md-default-bg-color--light: rgba(9, 15, 25, 0.72);
  --md-default-bg-color--lighter: rgba(15, 23, 42, 0.66);
  --md-default-bg-color--lightest: rgba(15, 23, 42, 0.45);
  --md-default-fg-color: var(--df-text);
  --md-default-fg-color--light: var(--df-text-secondary);
  --md-default-fg-color--lighter: var(--df-text-muted);
  --md-default-fg-color--lightest: rgba(148, 163, 184, 0.48);

  --md-typeset-color: var(--df-text-secondary);
  --md-typeset-a-color: var(--df-cyan);
  --md-code-bg-color: #050a11;
  --md-code-fg-color: #dbeafe;
  --md-footer-bg-color: #020617;
  --md-footer-bg-color--dark: #02050b;
}

[data-md-color-scheme="slate"] {
  --md-hue: 215;
  --md-default-bg-color: var(--df-surface);
  --md-default-fg-color: var(--df-text);
  --md-typeset-color: var(--df-text-secondary);
  --md-code-bg-color: #050a11;
}

html {
  scrollbar-color: rgba(103, 232, 249, 0.28) var(--df-midnight);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.08), transparent 27rem),
    linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    var(--df-surface);
  background-attachment: fixed;
  background-size: auto, 56px 56px, 56px 56px, auto;
  color: var(--df-text-secondary);
}

/* Main brand chrome */
.md-header {
  border-bottom: 1px solid var(--df-rule);
  background: rgba(7, 11, 18, 0.95);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.md-header__inner {
  min-height: 3.6rem;
}

.md-header__button.md-logo {
  margin-right: 0.35rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 2rem;
  height: 2rem;
  border-radius: 0.2rem;
}

.md-header__title {
  color: var(--df-text);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.md-tabs {
  border-bottom: 1px solid var(--df-rule);
  background: rgba(7, 11, 18, 0.94);
}

.md-tabs__link {
  color: var(--df-text-muted);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.69rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: var(--df-cyan);
}

/* Search */
.md-search__form {
  border: 1px solid var(--df-rule);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.6);
}

.md-search__form:hover,
.md-search__input:focus {
  border-color: var(--df-rule-cyan);
  background: rgba(15, 23, 42, 0.82);
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  border-color: var(--df-rule-cyan);
}

.md-search-result__meta {
  background: var(--df-midnight);
  color: var(--df-text-muted);
}

.md-search-result__link:hover {
  background: rgba(103, 232, 249, 0.06);
}

/* Navigation and table of contents */
.md-sidebar {
  background: rgba(7, 11, 18, 0.28);
}

.md-nav__title {
  background: transparent !important;
  color: var(--df-text);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.md-nav__link {
  color: var(--df-text-muted);
  transition: color 150ms ease, background 150ms ease;
}

.md-nav__link:hover,
.md-nav__link:focus,
.md-nav__link--active {
  color: var(--df-cyan);
}

.md-nav__link--active {
  font-weight: 650;
}

.md-nav__item .md-nav__link--active::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1rem;
  margin-right: 0.45rem;
  background: var(--df-cyan);
  box-shadow: 0 0 8px rgba(103, 232, 249, 0.45);
  vertical-align: -0.2rem;
}

/* Reading surface and typography */
.md-main {
  background: transparent;
}

.md-content {
  min-width: 0;
}

.md-content__inner {
  margin-bottom: 3rem;
}

.md-typeset {
  color: var(--df-text-secondary);
  font-size: 0.82rem;
  line-height: 1.72;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--df-text);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.md-typeset h1 {
  margin-bottom: 1.2rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.md-typeset h1::before {
  content: "DEFENDFLOW / DOCUMENTATION";
  display: block;
  margin-bottom: 0.8rem;
  color: var(--df-cyan);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.md-typeset h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--df-rule);
  font-size: 1.45rem;
}

.md-typeset h3 {
  font-size: 1.05rem;
}

.md-typeset a {
  color: var(--df-cyan);
  text-decoration-color: rgba(103, 232, 249, 0.35);
  text-underline-offset: 0.16rem;
}

.md-typeset a:hover {
  color: #cffafe;
}

.md-typeset strong {
  color: var(--df-text);
}

.md-typeset hr {
  border-bottom-color: var(--df-rule);
}

/* Cards and structured blocks */
.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li {
  border: 1px solid var(--df-rule);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.45);
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover {
  transform: translateY(-2px);
  border-color: var(--df-rule-cyan);
  background: rgba(103, 232, 249, 0.045);
}

.md-typeset .grid.cards .lg {
  color: var(--df-cyan);
}

.md-typeset table:not([class]) {
  border: 1px solid var(--df-rule);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.4);
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  border-bottom-color: var(--df-rule-cyan);
  background: rgba(103, 232, 249, 0.055);
  color: var(--df-text);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.md-typeset table:not([class]) td {
  border-top-color: var(--df-rule);
}

.md-typeset table:not([class]) tr:hover {
  background: rgba(103, 232, 249, 0.035);
}

/* Code is deliberately high-contrast and tool-like. */
.md-typeset code,
.md-typeset kbd,
.md-typeset pre {
  font-family: "Geist Mono", ui-monospace, monospace;
}

.md-typeset code {
  border: 1px solid rgba(103, 232, 249, 0.1);
  border-radius: 0.15rem;
  background: #050a11;
  color: #a5f3fc;
}

.md-typeset pre > code {
  border: 0;
}

.highlight {
  border: 1px solid var(--df-rule);
  border-radius: 0;
  background: #050a11;
}

.highlight:hover {
  border-color: rgba(103, 232, 249, 0.18);
}

.md-clipboard {
  color: var(--df-text-muted);
}

.md-clipboard:hover {
  color: var(--df-cyan);
}

/* Admonitions */
.md-typeset .admonition,
.md-typeset details {
  border-width: 0 0 0 2px;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.55);
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: rgba(103, 232, 249, 0.055);
  font-family: "Geist Mono", ui-monospace, monospace;
}

/* Footer and utility controls */
.md-footer {
  border-top: 1px solid var(--df-rule);
}

.md-footer-meta {
  border-top: 1px solid var(--df-rule);
}

.md-top {
  border: 1px solid var(--df-rule-cyan);
  border-radius: 0;
  background: var(--df-midnight);
  color: var(--df-cyan);
  box-shadow: none;
}

@media screen and (max-width: 76.234375em) {
  .md-nav--primary .md-nav__title[for="__drawer"] {
    border-bottom: 1px solid var(--df-rule);
    background: var(--df-midnight);
    color: var(--df-text);
  }

  .md-nav--primary {
    background: var(--df-surface);
  }
}

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

  .md-header__title {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
