/*
 * Infrastructure docs theme.
 * Direction: Kubernetes / Docker / HashiCorp / Traefik style docs, not a
 * marketing page. Keep the shell dense, neutral, searchable, and reference-led.
 */

:root,
[data-md-color-scheme="default"],
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #101820;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #2563eb;
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: #172033;
  --md-default-fg-color--light: #4b5870;
  --md-default-fg-color--lighter: #6b7890;
  --md-code-bg-color: #f8fafc;
  --md-code-fg-color: #1f2937;
  --md-code-hl-color: rgba(37, 99, 235, 0.1);
  --md-code-hl-number-color: #475569;
  --md-code-hl-special-color: #9d174d;
  --md-code-hl-function-color: #1d4ed8;
  --md-code-hl-constant-color: #92400e;
  --md-code-hl-keyword-color: #6d28d9;
  --md-code-hl-string-color: #047857;
  --md-code-hl-name-color: #1f2937;
  --md-code-hl-operator-color: #334155;
  --md-code-hl-punctuation-color: #475569;
  --md-code-hl-comment-color: #64748b;
  --md-code-hl-generic-color: #1f2937;
  --md-code-hl-variable-color: #be123c;
  --md-typeset-a-color: #2563eb;
  --md-footer-bg-color: #f7f9fc;
  --md-footer-bg-color--dark: #edf1f7;
  --infra-ink: #172033;
  --infra-muted: #526071;
  --infra-line: #d8e0eb;
  --infra-line-strong: #b7c3d2;
  --infra-surface-nav: #fbfcfe;
  --infra-blue: #2563eb;
  --infra-blue-dark: #1d4ed8;
  --infra-blue-soft: #eff6ff;
  --infra-green: #047857;
  --infra-code-bg: #f8fafc;
  --infra-code-bg-soft: #eef2f7;
  --infra-code-bg-strong: #f1f5f9;
  --infra-code-fg: #1f2937;
  --infra-code-muted: #64748b;
  --infra-code-line: #d8e0eb;
  --infra-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --infra-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #ffffff;
  color: var(--infra-ink);
  font-family: var(--infra-sans);
  text-rendering: optimizeLegibility;
}

::selection {
  background: #bfdbfe;
  color: #0f172a;
}

.md-header {
  background: #101820;
  border-bottom: 1px solid #223044;
  box-shadow: none;
  color: #f8fafc;
}

.md-header__title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.md-header__title,
.md-nav__title,
.md-nav__link,
.md-search__input,
.md-source,
.md-tabs__link {
  font-family: var(--infra-sans);
}

.md-header__button,
.md-header__button.md-icon,
.md-header__source,
.md-source,
.md-source__repository {
  color: #f8fafc;
}

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

.md-logo img,
.md-logo svg {
  width: 1.18rem;
  height: 1.18rem;
}

.md-search__form {
  border: 1px solid #334155;
  border-radius: 6px;
  background: #182232;
  box-shadow: none;
}

.md-search__form:hover,
.md-search__form:focus-within {
  border-color: #60a5fa;
  background: #1e293b;
}

.md-search__input {
  color: #f8fafc;
  font-size: 0.72rem;
}

.md-search__input::placeholder {
  color: #cbd5e1;
}

.md-container,
.md-main {
  background: #ffffff;
}

.md-main__inner {
  margin-top: 0;
}

.md-content__inner {
  margin: 0;
  padding: 2rem 2.2rem 4rem;
}

.md-typeset {
  max-width: 980px;
  color: var(--infra-ink);
  font-family: var(--infra-sans);
  font-size: 0.82rem;
  line-height: 1.68;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--infra-ink);
  font-family: var(--infra-sans);
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset h1 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--infra-line);
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.06;
}

.md-typeset h2 {
  margin: 2.3rem 0 0.85rem;
  padding-top: 0;
  border-top: 0;
  font-size: 1.32rem;
  line-height: 1.25;
}

.md-typeset h3 {
  margin-top: 1.5rem;
  color: var(--infra-ink);
  font-size: 1rem;
  line-height: 1.32;
}

.md-typeset h4 {
  font-size: 0.9rem;
}

.md-typeset p,
.md-typeset li {
  color: #334155;
}

.md-typeset a {
  color: var(--infra-blue);
  font-weight: 550;
  text-decoration-color: rgba(37, 99, 235, 0.28);
  text-underline-offset: 0.16em;
}

.md-typeset a:hover {
  color: var(--infra-blue-dark);
  text-decoration-color: currentColor;
}

.md-typeset strong {
  color: var(--infra-ink);
  font-weight: 700;
}

.md-typeset blockquote {
  border-left: 3px solid var(--infra-line-strong);
  color: var(--infra-muted);
}

.md-typeset code,
.md-typeset kbd,
.md-typeset pre,
.md-typeset table:not([class]) th,
.md-typeset .admonition-title,
.md-typeset summary {
  font-family: var(--infra-mono);
}

.md-typeset code:not(pre code) {
  border: 1px solid #dbe3ee;
  border-radius: 5px;
  background: #f5f7fb;
  color: #0f3f9d;
  font-size: 0.84em;
  font-weight: 550;
}

.md-typeset .highlight,
.md-typeset pre,
.md-typeset pre > code,
.md-typeset .highlighttable {
  border-radius: 8px;
}

.md-typeset .highlight {
  border: 1px solid #dbe3ee;
  background: var(--infra-code-bg) !important;
  box-shadow: none;
  overflow: hidden;
}

.md-typeset pre {
  background: var(--infra-code-bg) !important;
  color: var(--infra-code-fg) !important;
}

.md-typeset pre > code {
  background: var(--infra-code-bg) !important;
  color: var(--infra-code-fg) !important;
  font-size: 0.76rem;
  line-height: 1.65;
}

.md-content__inner > .highlight > .filename,
.md-typeset .highlight > .filename,
.md-typeset .highlighttable .filename {
  border-bottom: 1px solid var(--infra-code-line);
  background: var(--infra-code-bg-strong) !important;
  color: #334155 !important;
  font-family: var(--infra-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.md-content__inner > .highlight > .highlighttable > tbody > tr > .filename span.filename,
.md-typeset .highlighttable .filename span.filename {
  color: #334155 !important;
}

.md-content__inner > .highlight > pre > code,
.md-content__inner > .highlight > .highlighttable > tbody > tr > .code > div > pre > code,
.md-typeset .highlight pre code,
.md-typeset .highlighttable .code pre code {
  background: var(--infra-code-bg) !important;
  color: var(--infra-code-fg) !important;
}

.md-content__inner > .highlight > .highlighttable > tbody > tr > .linenos,
.md-typeset .highlighttable .linenos {
  border-right: 1px solid var(--infra-code-line);
  background: var(--infra-code-bg-soft) !important;
  color: var(--infra-code-muted) !important;
}

.md-typeset .highlighttable {
  border: 1px solid #dbe3ee;
  background: var(--infra-code-bg) !important;
  overflow: hidden;
}

.md-typeset .highlighttable td {
  padding: 0;
}

.md-typeset .highlighttable .linenos pre,
.md-typeset .highlighttable .linenos code {
  background: transparent !important;
  color: inherit !important;
}

.md-typeset .highlighttable .code {
  width: 100%;
  background: var(--infra-code-bg) !important;
}

.md-typeset .highlight .hll {
  background-color: var(--md-code-hl-color) !important;
}

.md-typeset .highlight,
.md-typeset .highlight code,
.md-typeset .highlight pre,
.md-typeset .highlighttable,
.md-typeset .highlighttable code,
.md-typeset .highlighttable pre {
  color: var(--infra-code-fg) !important;
}

.md-typeset .highlight .c,
.md-typeset .highlight .c1,
.md-typeset .highlight .cm,
.md-typeset .highlight .cp,
.md-typeset .highlight .cs,
.md-typeset .highlight .ch,
.md-typeset .highlight .sd {
  color: #64748b !important;
  font-style: italic;
}

.md-typeset .highlight .k,
.md-typeset .highlight .kc,
.md-typeset .highlight .kd,
.md-typeset .highlight .kn,
.md-typeset .highlight .kp,
.md-typeset .highlight .kr,
.md-typeset .highlight .kt,
.md-typeset .highlight .ow {
  color: #6d28d9 !important;
  font-weight: 650;
}

.md-typeset .highlight .s,
.md-typeset .highlight .s1,
.md-typeset .highlight .s2,
.md-typeset .highlight .sb,
.md-typeset .highlight .sc,
.md-typeset .highlight .dl,
.md-typeset .highlight .m,
.md-typeset .highlight .mi,
.md-typeset .highlight .mf,
.md-typeset .highlight .mh,
.md-typeset .highlight .mo {
  color: #047857 !important;
}

.md-typeset .highlight .na,
.md-typeset .highlight .nb,
.md-typeset .highlight .nc,
.md-typeset .highlight .nd,
.md-typeset .highlight .ne,
.md-typeset .highlight .nf,
.md-typeset .highlight .fm,
.md-typeset .highlight .nt {
  color: #1d4ed8 !important;
}

.md-typeset .highlight .nv,
.md-typeset .highlight .vc,
.md-typeset .highlight .vg,
.md-typeset .highlight .vi,
.md-typeset .highlight .vm {
  color: #be123c !important;
}

.md-typeset .highlight .o,
.md-typeset .highlight .p,
.md-typeset .highlight .go {
  color: #475569 !important;
}

.md-clipboard {
  color: rgba(51, 65, 85, 0.76) !important;
}

.md-clipboard:hover,
.md-clipboard:focus {
  color: #1d4ed8 !important;
}

.md-typeset table:not([class]) {
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  background: #f8fafc;
  color: var(--infra-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset table:not([class]) td {
  border-top-color: var(--infra-line);
  background: #ffffff;
}

.md-typeset .admonition,
.md-typeset details {
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
  color: var(--infra-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #bfdbfe;
}

.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
  background: var(--infra-blue-soft);
}

.md-nav {
  font-size: 0.72rem;
}

.md-nav__title {
  color: var(--infra-ink);
  font-weight: 700;
  letter-spacing: 0;
}

.md-sidebar--primary .md-sidebar__scrollwrap,
.md-sidebar--secondary .md-sidebar__scrollwrap {
  background: var(--infra-surface-nav);
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  border-right: 1px solid var(--infra-line);
}

.md-sidebar--secondary .md-sidebar__scrollwrap {
  border-left: 1px solid var(--infra-line);
}

.md-sidebar--primary .md-nav,
.md-sidebar--secondary .md-nav {
  padding-right: 0.8rem;
}

.md-nav__link {
  color: #536177;
  font-weight: 500;
}

.md-nav__link:is(:focus, :hover),
.md-nav__link--active {
  color: var(--infra-blue);
}

.md-nav__item .md-nav__link--active {
  font-weight: 700;
}

.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
  color: var(--infra-ink);
  font-weight: 700;
}

.md-typeset .tabbed-labels > label {
  font-family: var(--infra-sans);
  font-size: 0.72rem;
  font-weight: 700;
}

.md-typeset .tabbed-set {
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #ffffff;
}

.md-typeset .mermaid {
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--infra-ink);
  font-size: 0.85rem;
  max-width: 100%;
  margin: 1rem 0 1.25rem;
  overflow-x: auto;
  padding: 1rem;
  scrollbar-color: var(--infra-line-strong) #f8fafc;
}

.md-typeset .mermaid svg {
  display: block;
  width: max(100%, 1280px) !important;
  max-width: none !important;
  min-width: 1280px;
  height: auto !important;
}

.md-typeset .mermaid svg[aria-roledescription="flowchart-v2"] {
  width: max(100%, 880px) !important;
  min-width: 880px;
}

.md-typeset .mermaid .actor,
.md-typeset .mermaid .messageText,
.md-typeset .mermaid .labelText,
.md-typeset .mermaid .loopText,
.md-typeset .mermaid .noteText,
.md-typeset .mermaid text {
  fill: var(--infra-ink) !important;
  color: var(--infra-ink) !important;
}

.md-typeset .mermaid .messageLine0,
.md-typeset .mermaid .messageLine1,
.md-typeset .mermaid .flowchart-link {
  stroke: #334155 !important;
  stroke-width: 2px !important;
}

.md-typeset .mermaid .actor {
  fill: #eff6ff !important;
  stroke: #2563eb !important;
  stroke-width: 2px !important;
}

.md-typeset .mermaid .actor-line {
  stroke: #64748b !important;
  stroke-width: 1.5px !important;
}

.md-typeset .mermaid .labelBox,
.md-typeset .mermaid .loopLine {
  fill: #f8fafc !important;
  stroke: #94a3b8 !important;
  stroke-width: 1.5px !important;
}

.md-typeset .mermaid .note {
  fill: #fef3c7 !important;
  stroke: #d97706 !important;
  stroke-width: 1.5px !important;
}

.md-typeset .mermaid .activation0,
.md-typeset .mermaid .activation1,
.md-typeset .mermaid .activation2 {
  stroke: #2563eb !important;
  fill: #dbeafe !important;
}

.md-typeset .mermaid rect,
.md-typeset .mermaid polygon {
  fill-opacity: 1 !important;
  stroke-opacity: 1 !important;
}

.md-footer {
  border-top: 1px solid var(--infra-line);
  color: var(--infra-muted);
}

.md-footer-meta {
  background: #edf1f7;
}

.md-footer a {
  color: var(--infra-blue);
}

.docs-home {
  margin-top: 1rem;
}

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
  margin: 0 0 1.85rem;
  padding: 1.05rem;
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #f8fafc;
}

.docs-hero-copy {
  min-width: 0;
}

.docs-eyebrow,
.docs-card-kicker {
  display: block;
  margin: 0 0 0.55rem;
  color: var(--infra-green);
  font-family: var(--infra-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.md-typeset .docs-lead {
  max-width: 46rem;
  margin: 0 0 1rem;
  color: #334155;
  font-size: 1rem;
  line-height: 1.58;
}

.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.md-typeset .docs-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.45rem 0.78rem;
  border: 1px solid var(--infra-line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--infra-ink);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.md-typeset .docs-button:hover {
  border-color: var(--infra-blue);
  color: var(--infra-blue);
}

.md-typeset .docs-button-primary {
  border-color: var(--infra-blue);
  background: var(--infra-blue);
  color: #ffffff;
}

.md-typeset .docs-button-primary:hover {
  background: var(--infra-blue-dark);
  color: #ffffff;
}

.docs-snapshot {
  min-width: 0;
  padding: 0.95rem;
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #ffffff;
}

.docs-snapshot strong {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--infra-ink);
  font-size: 0.84rem;
}

.docs-snapshot ul {
  margin: 0;
  padding-left: 1rem;
}

.docs-snapshot li {
  margin-bottom: 0.34rem;
}

.docs-grid {
  display: grid;
  gap: 0.8rem;
  margin: 0.95rem 0 0;
}

.docs-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.md-typeset .docs-card {
  display: flex;
  min-height: 9.5rem;
  flex-direction: column;
  gap: 0.42rem;
  padding: 0.95rem;
  border: 1px solid var(--infra-line);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  text-decoration: none;
}

.md-typeset .docs-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.docs-card strong {
  color: var(--infra-ink);
  font-size: 0.92rem;
  line-height: 1.25;
}

.docs-card span:last-child {
  color: #536177;
  font-size: 0.76rem;
  line-height: 1.5;
}

@media screen and (max-width: 76.2344em) {
  .md-nav--primary .md-nav__title {
    background: #ffffff;
    color: var(--infra-ink);
    border-bottom: 1px solid var(--infra-line);
  }

  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    border-right: 0;
    border-left: 0;
    background: #ffffff;
  }
}

@media screen and (max-width: 60em) {
  .docs-hero,
  .docs-grid-2,
  .docs-grid-3 {
    grid-template-columns: 1fr;
  }

  .docs-hero {
    padding: 1rem;
  }
}

@media screen and (max-width: 44.9844em) {
  .md-content__inner {
    padding: 1.2rem 0.9rem 2.6rem;
  }

  .md-typeset h1 {
    font-size: clamp(1.8rem, 9vw, 2.55rem);
  }

  .md-typeset h2 {
    font-size: 1.18rem;
  }

  .docs-actions {
    flex-direction: column;
  }

  .md-typeset .docs-button {
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
